Find Peak Element
Medium
Binary Search
A peak element is strictly greater than its neighbours (treat the outside as negative infinity). Given an array where adjacent elements are different, print the index of any peak in O(log n).
Constraints
1 <= n <= 1000 -2^31 <= nums[i] <= 2^31 - 1
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.