How it works
Core operators
AND, OR, XOR, NOT, and left and right shifts read and change bits directly.
Common tricks
XOR cancels duplicates, n and (n minus 1) clears the lowest set bit, and masks toggle flags.
Bitmasks
A single integer can represent a set of up to 64 booleans, useful in subset and dynamic programming problems.