Peak of a Mountain
arr is a mountain: it strictly increases up to one peak and then strictly decreases, and it has at least 3 items. Return the index of the peak.
This can be done with binary search, but a plain loop is fine too.
Example 1
arr [0,2,1,0]
returns 1
The peak 2 is at index 1.
Constraints
3 <= len(arr) <= 40- The list is a valid mountain.
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.