Problem Description

Read n integers. A peak means a[i] is greater than both neighbours (i-1 and i+1). Output the first peak index (0-based). If no peak, output -1.

Input Format

First line n. Second line n integers.

Output Format

One integer index.

Sample Test Case

Input:
7 1 2 3 2 2 5 1
Output:
2

Constraints

3

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next