"""
https://leetcode.com/problems/find-peak-element/submissions/
"""
from typing import List


class Solution:
    def findPeakElement(self, nums: List[int]) -> int:
        l, r = 0, len(nums)-1
        while l < r:
            lmid = (l + r) // 2
            rmid = lmid + 1
            if nums[lmid] < nums[rmid]:
                l = lmid + 1
            else:
                r = rmid - 1
        return l

[]