Algorithms & Data Structures
Intermediate
Pro
Bit Manipulation
Trade hash sets and extra memory for a handful of bitwise tricks
20 min read
1 view
Learn the core bitwise operators and the small set of identities — XOR cancellation, n & (n-1), n & -n — that unlock O(1)-space solutions to classic interview problems. Covers counting set bits with DP, finding a lonely element with XOR, and rearranging bits with masks and shifts.