solve(arr) — arr is a mountain: it has at least 3 values, strictly increases up
to a single peak, then strictly decreases. Return the index of the peak. Run in
O(log n) — a scan for the maximum is not the point.
Look at the slope at mid: if arr[mid] < arr[mid + 1] you are still climbing, so the
peak is to the right; otherwise it is at mid or to its left.
Examples
solve([0,1,0]) → 1
solve([0,2,1,0]) → 1
solve([1,3,5,7,6,4,2]) → 3Sample tests