
The first line contains a single integer ‘T’ representing the number of test cases.Then test cases follows :
The first line of each test case contains an integer ‘N’.
The second line of each test case contains ‘N’ space-separated integers denoting the elements of array ‘A’.
For each test case, print true if the array can be divided into groups of pairs with XOR 0, else print false.
Print the output of each test case in a new line.
You don’t need to print anything. It has already been taken care of. Just implement the given function.
1 <= T <= 100
1 <= N <= 10^5
1 <= A[i] <= 10^5
Time Limit : 1 sec
We can see that if any element is present an odd number of times , then there will be no pair for it.
Since, to get XOR 0, we require to pair number ‘a’ with the same number.
Thus, we can just check if any element is present an odd number of times.