Optimal Algorithmic Approach
Binary search using the slope direction to narrow the search.
Core Invariants & Edge Cases
- Binary search: if nums[mid] < nums[mid+1], peak is to the right
- Otherwise peak is at mid or to the left
- Boundary elements count as neighbors -∞