Timeline
timeline
2025-12-03
init
divide and conquer
Title:
- If nums[mid] < nums[mid + 1] ⇒ peak must be in the right half
Because from left to right it is increasing, and the rightmost is -∞, the right half must have a peak (even if monotonically increasing, the last one is a peak). - If nums[mid] > nums[mid + 1] ⇒ peak must be in the left half
Because from right to left it is increasing, and the leftmost is -∞, the left half must have a peak.
1 |
|
