Search in a Rotated Sorted Array
A sorted array of distinct values was rotated at an unknown point (e.g. 4 5 6 7 0 1 2). Find the index of or print -1 — in .
Input
and the rotated array, then .
Output
The index or -1.
Constraints
Sample 1
Input
7 4 5 6 7 0 1 2 0
Output
4
Sample 2
Input
7 4 5 6 7 0 1 2 3
Output
-1