Bit manipulation operates directly on the binary representation of integers. It's fast (single CPU instruction), compact, and enables clever tricks.
Use cases:
- Subset enumeration with bitmasks.
- Checking properties (odd/even, power of two).
- Compact state representation (visited sets, DP states).
- XOR tricks for finding duplicates.
I'll teach you bitwise operators, common patterns, and classic problems that rely on bit tricks.