Unique number-1

sir please explain me working of for loop with help of example like as 2,3,4,6,4,3,2
first take a no. 2
then operation 0^2 which value is give

for the custom input
7
1 1 2 2 3 3 4
for a^b if a==b we get 0 and 0 xor a is a

you can see this:

r  ^  n  = Result
0     1     1 
1     1     0 
0     2     2 
2     2     0 
0     3     3 
3     3     0 
0     4     4