Given a set of positive integers. The task is to complete the function maxSubarrayXOR which returns an integer denoting the maximum XOR subset value in the given set.
Input Format:
The first line of input contains an integer T denoting the no of test cases. Then T test cases follow. Each test case contains two lines. The first line of input contains an integer N denoting the size of the array A[]. Then in the next line are N space separated values of the array.
Output Format:
For each test case in a new line output will be the maximum XOR subset value in the given set.
Your Task:
You need to complete the function maxSubarrayXOR.
Constraints:
1 <= T <= 100
1 <= N <= 50
Example:
Input:
2
3
2 4 5
3
9 8 5
Output:
7
13
Explanation:
Testcase1:
Input: set[] = {2, 4, 5}
Output: 7
The subset {2, 5} has maximum XOR value
Testcase2:
Input: set[] = {9, 8, 5}
Output: 13
The subset {8, 5} has maximum XOR value
blackshadows | 210 |
xmyqsh | 198 |
hanuman001 | 164 |
Adarsh Trivedi | 148 |
layman_brother | 144 |
blackshadows | 692 |
xmyqsh | 539 |
aman19 | 398 |
r0c2048 | 360 |
kspk | 331 |
akhayrutdinov | 5005 |
Ibrahim Nash | 4871 |
Quandray | 4338 |
sanjay05 | 3668 |
blackshadows | 3196 |