1. Search the Half That Is Sorted Optimal
Intuition
The rotation point lies in one half, which means the other half is cleanly sorted — and in a sorted half, a simple range check says whether the target is inside. So each step: work out which half is sorted, ask whether the target lives there, and recurse into that half or the other. Ordinary binary search with one extra question.
Algorithm
1. Take the middle; if it is the target, done.
2. If the number at mid is smaller than the number at right, mid to right is sorted: the search keeps it when nums[mid] < target <= nums[right], and the other half otherwise.
3. Otherwise left to mid is sorted: the search keeps it when nums[left] <= target < nums[mid], and the other half otherwise.
4. Exhausting the range means the target is absent.
Time & Space
Time O(log n). Space O(1).