Optimal Algorithmic Approach
Modified binary search: at each step, identify the sorted half and check if target belongs there.
Core Invariants & Edge Cases
- One half is always sorted; determine which half and narrow search
- If nums[mid] >= nums[left]: left half is sorted
- Check if target falls in the sorted half; otherwise search the other half