I was studying on leetcode for an interview. There were a question about finding missing number unpaired in array. I solved it by using HashSet. But i saw the below solution which is more efficient than mine.My question is that what the logic XOR of a ^= nums[i] means ?
int a = 0;
for (int i = 0; i < nums.length; i++) {
a ^= nums[i];
}
return a;