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 unique element
Return result
We start with zero and XOR it with every element in the array. Because XOR of two same numbers is zero, all repeating elements cancel out, leaving only the unique element.
