结贴

    def findPeakElement(nums) -> int:# 默认一定有解,返回解的下标
        left, right = 0, len(nums)-1
        while left < right:
            mid = (left + right) // 2
            if nums[mid] > nums[mid+1]:
                right = mid
            else:
                left = mid + 1
        return left