Given a sorted array of distinct integers that has been rotated at an unknown pivot, and a target value, find the index of the target if it exists in the array. Otherwise, return -1.
{
"nums": [
4,
5,
6,
7,
0,
1,
2
],
"target": 0
}4{
"nums": [
4,
5,
6,
7,
0,
1,
2
],
"target": 3
}-1{
"nums": [
1
],
"target": 0
}-1Sign in to Run Code and Submit