We’re preparing your current view and syncing the latest data.
You are given an array of integers. Your task is to find the maximum XOR value of any two elements in the array.
The first line contains an integer T, the number of test cases. Each test case consists of two lines: the first line contains an integer N, the size of the array. The second line contains N space-separated integers representing the array elements.
For each test case, output a single integer denoting the maximum XOR value of any two elements in the array.
1 <= T <= 10 2 <= N <= 10^5 0 <= array elements <= 10^9
Example 1
Input
1 3 1 2 3
Output
3
Explanation
The maximum XOR of two elements is 3 (1 XOR 2 = 3).