Find Peak Element
Recognize the pattern
Brute force idea
A straightforward first read of Find Peak Element is this: Scan left to right, return first element greater than its neighbors. Simple but doesn't exploit the structure. That instinct is useful because it follows the prompt literally, but it usually keeps revisiting work the problem is begging you to organize.
Better approach
A calmer way to see Find Peak Element is this: Binary search: if nums[mid] < nums[mid+1], a peak must exist to the right (the array goes up). If nums[mid] < nums[mid-1], a peak must exist to the left. Go toward the higher neighbor. The goal is not to be clever for its own sake, but to remember the one relationship that keeps the solution grounded as you move forward.
Key invariant
The truth you want to protect throughout Find Peak Element is this: Moving toward the higher neighbor guarantees you'll eventually reach a peak. The array boundaries are -∞, so any upward trend must peak somewhere before going out of bounds. If that remains true after every update, the rest of the reasoning has a stable place to stand.
Watch out for
A common way to get lost in Find Peak Element is this: Thinking you need to find THE peak — you only need ANY peak. Also, comparing with both neighbors at once is unnecessary; comparing with just mid+1 is enough to decide direction. Most mistakes here are not about syntax; they come from losing track of what your state, pointer, or structure is supposed to mean.