Tip 1: Practice on CodeStudio and solve medium-level problems on CodeStudio.
Tip 2: Brush up on computer fundamentals from subjects like OS, DBMS, and CN.
Tip 3: Have a strong project or internship experience and in-depth work knowledge.
Tip 1: Have some projects on your resume.
Tip 2: Do not put false information on your resume.



1. There are no 2 adjacent elements having same value (as mentioned in the constraints).
2. Do not print anything, just return the index of the peak element (0 - indexed).
3. 'True'/'False' will be printed depending on whether your answer is correct or not.
Input: 'arr' = [1, 8, 1, 5, 3]
Output: 3
Explanation: There are two possible answers. Both 8 and 5 are peak elements, so the correct answers are their positions, 1 and 3.
Divide and Conquer can be used to find a peak in O(Log n) time. The idea is based on the technique of Binary Search to check if the middle element is the peak element. If the middle element is not the peak element, check if the element on the right side is greater than the middle element; in that case, there is always a peak element on the right side. If the element on the left side is greater than the middle element, there is always a peak element on the left side. By forming a recursion, the peak element can be found in O(log n) time.



Suppose ‘A’ = “brute”, and ‘B’ = “groot”
The shortest supersequence will be “bgruoote”. As shown below, it contains both ‘A’ and ‘B’ as subsequences.
A A A A A
b g r u o o t e
B B B B B
It can be proved that the length of supersequence for this input cannot be less than 8. So the output will be bgruoote.
This problem is closely related to the longest common subsequence problem.
Steps:



1. Coordinates of the cells are given in 0-based indexing.
2. You can move in 4 directions (Up, Down, Left, Right) from a cell.
3. The length of the path is the number of 1s lying in the path.
4. The source cell is always filled with 1.
1 0 1
1 1 1
1 1 1
For the given binary matrix and source cell(0,0) and destination cell(0,2). Few valid paths consisting of only 1s are
X 0 X X 0 X
X X X X 1 X
1 1 1 X X X
The length of the shortest path is 5.
Algorithm:



A mapping from Digits to Letters (just like in Nokia 1100) is shown below. Note that 1 does not map to any letter.







You are given ‘STR’ = “aabcd”. Then our answer will be “dcbaabcd”. We can form a palindrome by adding ‘d’, ‘c’, and ‘b’ in front of ‘STR’.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
How do you remove whitespace from the start of a string?