You are given a list of unique integers which are sorted but rotated at some pivot. You are also given a target value and you have to find its index in the list. If it is not present in the list, return -1.
Example:
List: [4, 5, 6, 7, 1, 2, 3]
Target value: 6
Resultant index: 2
The first line contains 'T', denoting the number of test cases.
Each test contains 3 lines:
T lines, each containing a number denoting the index of the target value. -1 if the target value is not present.
4
7
4 5 6 7 0 1 2
4
4
3 4 1 2
5
5
5 1 2 3 4
2
4
5 6 3 4
4
0
-1
2
3
1 <= T <= 100
1 <= n <= 104
1 <= array elements <= 106
1 <= target <= 106