Pattern
Use binary operations for flags, parity, masks, and arithmetic shortcuts.
Identify the bit identity that preserves the needed information.
count = 0 while n: n &= n - 1 count += 1 print(count)
Arrays
Bit Manipulation