Unique Number 2

Unique Number 2 how to solve this problem of bitmasking?

Hint: xor of 2 equal numbers is 0

I know this. Thta’s how I solved unique number 1 but not to unique number 2

Let x and y be the non-repeating elements we are looking for and arr[] be the input array. First calculate the XOR of all the array elements.
All the bits that are set in xor will be set in one non-repeating element (x or y) and not in other. So if we take any set bit of xor and divide the elements of the array in two sets – one set of elements with same bit set and other set with same bit not set. By doing so, we will get x in one set and y in another set. Now if we do XOR of all the elements in first set, we will get first non-repeating element, and by doing same in other set we will get the second non-repeating element.

couldn’t understand the 2nd paragraph

go to this link