// Search in Rotated Sorted Array — MEDIUM
// Category: binary-search
Given a rotated sorted array `nums` (with unique values) and a `target`, return the **index** of `target` if it is in the array, or `-1` otherwise.
You must write an algorithm with **O(log n)** runtime complexity.
Hint: In each binary search step, one half is always sorted — use that to decide which half to search next.
Example: nums = [4, 5, 6, 7, 0, 1, 2], target = 0
Output: 4