← PATTERN ATLAS
PATTERN 16 · 5 PROBLEMS

Bit manipulation

Use bit identities to store many binary facts in one integer.

Start the first lesson ↗
MASTER KEYWrite the bit truth table before the code.
0OF 5
RECALLED
RECOGNITION SIGNAL

n & (n−1) removes the lowest set bit.

01
Not started

Number of 1 Bits

n & (n−1) removes the lowest set bit.

↗
02
Not started

Counting Bits

Removing the lowest set bit reaches a smaller number already solved.

↗
03
Not started

Reverse Bits

Every step transfers the current low bit into the next result position.

↗
04
Not started

Missing Number

Equal values cancel under XOR, leaving only the missing value.

↗
05
Not started

Sum of Two Integers

XOR adds without carry; AND shifted left computes the carry.

↗