XOR Pairing — Fold the Array, Split the Singles

Watch XOR-all fold an array into one accumulator (pairs cancel via x^x=0), then watch the two-singles split-by-a-set-bit route the two unique values into separate groups.

step 0

Array (editable above)

accumulator = 0
Press Step to fold the first element into the accumulator.
current element bit = 1 bit = 0 group A (bit set) group B (bit clear)
We compute the XOR of every element. Even-count values cancel (x^x=0); the odd one survives (x^0=x).
Self-contained visualization. Counting/parity semantics over GF(2): XOR records per-bit parity, so values appearing an even number of times vanish and the odd one(s) remain. See junior.md and professional.md for the proof that XOR-all returns the odd-count element, and that splitting on a bit of a^b separates two singles.