NumPy allowed · plain Python earns 10 bonus points
Search for a target value in a sorted array that has been circularly rotated, maintaining O(log n) time complexity.
Implement search_rotated_array(nums, target): determine which half of the array [lo..mid] or [mid..hi] is sorted, then check if target falls within that sorted segment to narrow down the search window.
search_rotated_array(nums: list[int], target: int) -> int