A rotated sorted array isn't sorted end to end — but split at any point, one half always is.
At each step, figure out which half of [left, right] is sorted by comparing
nums[left] to nums[mid], then check whether the target falls inside
that sorted half's range. If it does, search there — otherwise it must be in the other half.