Concept Flow - Two Non Repeating Elements in Array Using XOR
XOR all elements
→Result = XOR of two unique numbers
Find rightmost set bit in Result
Divide elements into two groups based on this bit
XOR elements in each group separately
Get two unique numbers
Done
We first XOR all numbers to get XOR of two unique numbers. Then find a set bit to split numbers into two groups. XOR each group to find the unique numbers.
