NeetCode #273LC-162MediumBinary Search
← Back to All Problems

#273 · #162 · Find Peak Element(寻找峰值)

📌 Problem Statement & Constraints

A peak element is one strictly greater than its neighbours. Given an integer array nums, return the index of any peak. Assume nums[-1] = nums[n] = -infinity, so the boundaries can be peaks. The solution must run in O(log n). Constraints: 1 <= nums.length <= 1000, -2^31 <= nums[i] <= 2^31 - 1.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!