I have a doubt that after calculating the pos. of the first bit pair we are taking "AND" of the array menmbers to left shifted one to check that if any element present with the same bit at the same position it give us 1

let us assume XOR of array element is =01010
1.then we calculate pos. of the first bit pair its 1
2 then we calculate the members have same bit at the same pos.
i don"t understand how the XOR of x with ( array element having same bit at the position ) gives us the first number which no pair in array

x=x ^ arr [ i ] // how it give us the first number

Hello @anshulgurawalia we are doing the shifiting the time after getting xor we will get the same bit i.e 1 then we will break there.
have you seen the editorial for that?

okky got it thanks a lot !!

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.