Problem Statement
There is an integer array nums sorted in ascending order (with distinct values). Prior to being passed to your function, nums is possibly rotated at an unknown pivot index k. Given the array nums after the possible rotation and an integer target, return the index of target if it is in nums, or -1 if it is not in nums.
Approach
Perform binary search. In each step, at least one half of the array (left to mid or mid to right) will be sorted. Check if the target lies within the sorted half range. If it does, eliminate the other half. If not, search the other half.
Time & Space Complexity
Time complexity is O(log n). Space complexity is O(1).
