A sorted array of distinct integers was rotated at an unknown pivot (e.g. [0,1,2,4,5,6,7] → [4,5,6,7,0,1,2]). Given the rotated array nums and a target, return its index or -1, in O(log n).
Input
targetOutput: the index, or -1.
4 5 6 7 0 1 2 0
4
4 5 6 7 0 1 2 3
-1
Run your code against the sample tests, or Submit to run the full suite.