Approach hintTry it first, then revealHide
At every step at least one half around mid is sorted; check whether the target lies within that sorted half's range and discard the other half accordingly. O(log n).
At every step at least one half around mid is sorted; check whether the target lies within that sorted half's range and discard the other half accordingly. O(log n).