An array is called Bitonic if it is comprises of an increasing sequence of integers followed immediately by a decreasing sequence of integers.
Given a bitonic array A of N distinct integers. Find a element X in it.
First line will consist a number T, the number of test cases. First line of each test case will consist of positive integer N. Next line contains array elements and third line contains X.
Print the index where element found. If element not found, print "-1" (without quotes).
1 <= T <= 100
1 <= N <= 107
-107 <= Ai <= 107
1 2 7 4 3
Testcase 1: 2 is found at index 1 in the given array.
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.