DSAverse
Bit Manipulation
Loading Bit Manipulation...
Binary Register
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
bit 15bit 0
Initializing Sorting Algorithms...
Sorting
Trees
Graphs
Preparing interactive visualizations...
Bit Manipulation
Loading Bit Manipulation...
Binary Register
Find the element that appears only once when every other appears twice. XOR cancels duplicate pairs in a single O(n) pass with no extra space.
An interactive step-by-step visualization for Single Number (XOR) is currently being built. You will be able to watch each XOR operation update the binary register and see duplicates cancel out.
Back to Bit Manipulation