Concept Flow - Find the Only Non Repeating Element Using XOR
Start with result = 0
Take next element from array
Apply XOR: result = result XOR element
More elements?
Yes→Repeat XOR step
No
Result holds the non-repeating element
End
We start with zero and XOR it with each element in the array one by one. Because XOR of two same numbers is zero, all repeating elements cancel out, leaving only the unique element.
