
The first line of input contains an integer ‘T’, denoting the number of test cases.
The first line of each test case contains one integer ‘N’, denoting the number of robots.
The following line contains an array ‘P’ of ‘N’ spaced integers denoting the power of each robot.
For each test case, print a single integer denoting the index of the robot Bob has selected or -1 if Bob’s robot can not win all the fights.
You are not required to print the expected output. It has already been taken care of. Just implement the function.
1 <= T <= 5
1 <= N <= 10^5
1 <= A[i] <= 10^9
Time Limit: 1 sec
Firstly we need to find the power of the robot Bob will select, which will be equal to the maximum value present in the array ‘P’. After finding the maximum value of the array, we need to compare it with all the other values in the array. If the maximum value is greater than or equal to twice the values of other robots, we will return the index of the maximum value else, return -1.