Given an integer array and an element x. Find if the given element is present in array or not. If present, print index of its first occurrence, else print "-1" (without quotes).
Input:
First line contains an integer, the number of test cases 'T'. For each test case, first line contains an integer 'N', size of array. The second line contains the elements of the array separated by spaces. Third line contains element to be find in the array.
Output:
For each testcase, output a single line containing first index of element to be found in array. If element is not in the array, then print "-1" (without quotes).
Constraints:
1 <= T <= 100
1 <= N <= 100
1 <= Arr[i] <= 100
Example:
Input:
1
4
1 2 3 4
3
Output:
2
Explanation:
There is one test case with array as {1, 2, 3 4} and element to be searched as 3. Since 3 is present at index 2, output is 2
11620078 | 164 |
RohitBattu | 127 |
Maninder07 | 126 |
blackshadows | 120 |
Rags Bhasin | 110 |
blackshadows | 880 |
xmyqsh | 565 |
mb1973 | 439 |
aman19 | 402 |
shubhamjain237 | 376 |
akhayrutdinov | 5014 |
Ibrahim Nash | 4899 |
Quandray | 4338 |
sanjay05 | 3668 |
blackshadows | 3384 |