Find Peak Element — JavaScript medium interview problem
A peak element is strictly greater than its neighbors. Given `nums`, find a peak and return its index. `nums[-1]` and `nums[n]` are considered -∞. Any peak is acceptable.
Tags: binary-search
Practice this Arrays problem free in the JS Interview Playground with automated tests and unlockable solutions.