nums is a mountain: its values are all different and strictly increase up to a peak, then strictly decrease (the peak can be the first or the last value, for example [1, 2, 3] or [3, 2, 1]). Return the index of the peak, which is also the position of the largest value.
Example 1
Input:
mountain_peak([1, 3, 5, 4, 2])
Output:
2
Example 2
Input:
mountain_peak([1, 2, 3])
Output:
2
1 <= len(nums) <= 2 * 10**50 <= nums[i] <= 10**9in, .index, .count, min or sorted on the whole list, fails them.No results yet
Run your code to check it against the examples, or submit to run every test.