Concept Flow - Find the Only Non Repeating Element Using XOR
Start with result = 0
For each element in array
Apply XOR: result = result XOR element
Repeat for all elements
Result holds the non-repeating element
Return result
We start with zero and XOR it with every element in the array. Pairs cancel out, leaving only the unique element.
