Approach hintTry it first, then revealHide
If nums[mid] < nums[mid + 1], the values climb to the right, and since the array is treated as minus infinity beyond its ends, a peak must lie there; otherwise one lies at mid or to its left.
If nums[mid] < nums[mid + 1], the values climb to the right, and since the array is treated as minus infinity beyond its ends, a peak must lie there; otherwise one lies at mid or to its left.