‘A’ = [1, 3, 2, 5]
A[3] = A[3] or A[1] = 3 | 5 = 7
‘A’ = [1, 3, 2, 7]
Hence the maximum element we can obtain is 7.
Therefore, the answer is 7.
First-line contains 'T,' denoting the number of Test cases.
For each Test case:
The first line contains an integer ‘N’ denoting the number of students.
The second line contains ‘N’ elements of array ‘A’.
Return the maximum element ‘X’ you can obtain by operating zero or more times.
You don't need to print anything. Just implement the given function.
1 <= 'T' <= 10
1 <= 'N' <= 10^5
1 <= 'A[i]' <= 2^30
Time Limit: 1 sec
Algorithm:-