Search In Rotated Sorted Array
medium
1. There is an integer array nums sorted in ascending order (with distinct values). 2. nums is rotated at an unknown pivot index k (0
Constraints
1 <= nums.length <= 5000 -10^4 <= nums[i] <= 10^4 All values of nums are unique. nums is guaranteed to be rotated at some pivot. -10^4 <= target <= 10^4
Format
Input
Input is managed for you
Output
Output is managed for you
Example
Sample Input
7
4 5 6 7 0 1 2
1
Sample Output
5
Question Video