Code
Loading editor...
Tap Analyze to see visualization
Click Analyze to visualize
See step-by-step execution, variables, and output
Variables
Run code to see variables
Output
Console output will appear here
Click Analyze to visualize
See step-by-step execution, variables, and output
Run code to see variables
Console output will appear here
For each of the 32 bit positions, sum that bit across all numbers. Take the sum modulo 3 to isolate the unique element's bit at that position. Reconstruct the result by OR-ing each surviving bit back into place.
Every number appearing three times contributes a multiple of 3 to each bit position sum, so mod 3 eliminates their contribution and reveals only the single element's bits.
Updated Feb 2026