Which optimized bit manipulation pattern solves this lesson cleanly?
Practice this question from Power of Two - n and n-1 Pattern Practice Quiz, with options and an explanation.
Question
Which optimized bit manipulation pattern solves this lesson cleanly?
Option A — Correct answer
Positive n and n & (n - 1) equals zero.
Option B
Nested loops without bit identities
Option C
Sliding window only
Option D
Min-heap of size k only
Explanation
Positive n and n & (n - 1) equals zero.