Week 5 · Day 34 of 42

Bit Manipulation: XOR Tricks

a ^ a = 0, a ^ 0 = a. XOR of all elements cancels pairs — the unpaired element remains.

Checking access

Spotted a mistake on this page?

Wrong formula, broken animation or confusing wording. Tell us and we will fix it.