

The first line contains an integer 'T' which denotes the number of test cases or queries to be run. Then the test cases follow.
The first line of each test case contains a single integer 'N’ denoting the number of elements in the ‘ARR’.
The second line of each test case contains ‘N’ single space-separated integers, denoting the elements of the ‘ARR’.
For each test case, print the largest element in the given array/list.
Print the output of each test case in a separate line.
You are not required to print the expected output, it has already been taken care of. Just implement the function.
1 <= T <= 100
1 <= N <= 10^5
1 <= ARR[i] <= 10^5
Where ‘T’ is the number of test cases, ‘ARR’ is the given array and ‘N’ denotes the number of elements in the ‘ARR’.
Time Limit: 1 sec
We have a simple brute force solution to this problem. We will iterate through each element in ‘ARR’ and find the largest element. Finally, we return that element as our answer.
Here is the complete algorithm :
For a sorted and rotated array/list, the largest element might be somewhere in between the array/list. We can solve this in O(log N) time using a binary search approach. We will have the lower limit ‘low’ and the upper limit ‘high,’ from which we will calculate the ‘mid’ as ‘(high + low) / 2’. Initial values of ‘low’ and ‘high’ are 0 and ‘N’ - 1 where ‘N’ is the number of elements in ‘ARR’.
Now, the following four cases arise: