LearnPy Hub
← Arena
IntermediateRating 1300

Find a Peak

Adjacent elements are different. Print the index of the leftmost element strictly greater than its neighbours (edges count as -∞).

Input

n, then n integers.

Output

An index.

Sample 1

Input
4
1 2 3 1
Output
2

Sample 2

Input
7
1 2 1 3 5 6 4
Output
1
solution.py
Output appears here
Find a Peak · Python Arena problem · LearnPy Hub