You are given N 64-bit integers (or long longs). You need to remove one of then so that the XOR of those N-1 (all of them without the one that has been removed) integers, is as large as possible. Print out the XOR in the console. The number of integers will not exceed 1e6.
By XOR of all the integers I mean something like this:
long long myXor=0;
for(int i = 0;i<arr.size();i++){
myXor=xor(myXor,arr[i]);
}
Also, this is not my homework. I know posting homework here is frowned upon. I've been trying to solve this my self, but I've only come up with solutions that work in O(n^2).