Given an array of elements which is first increasing and then may be decreasing, find the maximum element in the array.
Note: If the array is increasing then just print then last element will be the maximum value.
The first line of input contains an integer T denoting the number of test cases.
The first line of each test case is N, the size of array, the second line of each test case contains N integers which are the array elements.
Print the maximum element in the array.
1 ≤ T ≤ 50
3 ≤ N ≤ 106
1 ≤ Ai ≤ 106
1 15 25 45 42 21 17 12 11
1 45 47 50 5
Testcase 1: Maximum element is 45 which is present at bitonic point.
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.