


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.
The first line contains an integer ‘n’, the number of elements in 'arr'.
The second line contains ‘n’ space-separated integers , the array 'arr'.
The output contains True/ False depending whether the found number is peak element or not.
Keeping the above example in mind, we can write the following solution:
Keeping in mind the above ideas, we can use the following approach: