Peak of a mountain list
heights is shaped like a mountain: its values strictly rise to a single highest value and then strictly fall, as in [1, 4, 7, 5, 2]. Return the index of that highest value.
Constraints: len(heights) >= 3, and the peak is never the first or the last value. Aim for O(log n): scanning for the maximum reads every value.
Examples
peak_index([0,1,0])→1peak_index([1,4,7,5,2])→2peak_index([0,10,5,2])→1