https://leetcode.com/problems/peak-index-in-a-mountain-array/description/
水题,从前往后遍历找第一个下降点即可。
class Solution:
def peakIndexInMountainArray(self, A):
"""
:type A: List[int]
:rtype: int
"""
n = len(A)
i = 0
while i+1 < n and A[i] < A[i+1]:
i += 1
return i