


1. A magic index in an array A[0 ... N - 1] is defined to be an index i such that A[i] = i.
2. The elements in the array can be negative.
3. The elements in the array can be repeated multiple times.
4. There can be more than one magic index in an array.
The first line of the input contains an integer T denoting the number of test cases.
The first line of each test case contains one integer N, as described in the problem statement.
The second line of each test case contains N space-separated integers, representing the elements of the array.
For each test case print in a new line, one integer representing the magic index of the given array or -1 if there does not exist any magic index for the given array.
In case there is more than one magic index, return any of them.
1 <= T <= 10
1 <= N <= 10^5
-10^9 <= A[i] <= 10^9
Time Limit: 1sec
Longest Substring with K-Repeating Characters
Expression Add Operators
Gray Code Transformation
Minimized Maximum of Products Distributed to Any Store
Count of Subsequences with Given Sum