162-Find-Peak-Element
Sat 17 May 2025
https://leetcode.com/problems/find-peak-element
import pyutil as pyu
pyu.get_local_pyinfo()
print(pyu.ps2("python-dotenv"))
from typing import List
class Solution:
def findPeakElement(self, nums: List[int]) -> int:
l = 0
r = len(nums) - 1
while l < r:
m = (l + r) // 2
if nums[m] >= nums[m + 1]:
r = m
else …Category: leetcode
Read More