Every value in an array appears twice except one. Find it, and tell me when bit tricks are worth reaching for
XOR-folding the array leaves the unpaired value because a^a is 0 and XOR is commutative and associative, giving O(n) time and O(1) space under a precondition worth stating. That specific trick is narrow; masks used as integer sets are the part of bit manipulation that earns real work.