Given a set A[ ] of positive integers. The task is to find the maximum XOR value of the elements from all the possible subsets.
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow.
The first line of each test case contains an integer N, where N is the size of the set A[ ]. The second line of each test case contains N space separated integers, denoting elements of the set A[ ].
Print out the maximum XOR subset value.
1 <= T <= 100
1 <= N <= 30
0 <= A[i] < 1000
2 4 5
33 73 64
5 633 64 43 131 51 87 999 23
Testcase 1: The maximum XOR value form possible subsets of the given array elements is : 7(2^5), where ^ is the symbol of XOR.
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.