← Interval & Math

Micro-Drill #122 — Check if power of two

Interval & Math Target: 5s

Single-bit check via n & (n-1) == 0. Fastest power-of-two test.

n > 0 and n & (n - 1) == 0

Type it from memory. Go.

Practice Problems

Related Coding Drills

← Micro #121 Micro #123 →