after performing the xor of all numbers in the array we are finding the set bit(for example array={5,2,3,5,2,7} after xor operation we get 4 and bit-2 is set ) but what if the number of set bits are more than 1 (example:1111 in binary)?
Unique number-ii concept(Bit Masking)
Will work in that case as well
Do a dry run on some example say
2 2 3 5
This is the code I wrote its not working for 2 2 3 5 . I am getting 6 and 0 as output . how should i modify it ?