Bit Manipulation Checkpoint

Work fresh traces, diagnose invalid implementations, and identify model boundaries.


Get every question correct to pass this checkpoint. You can review feedback, revise your answers, and submit again.

1. How many iterations does repeatedly applying n &= n-1 take for n=44?
2. An XOR singleton algorithm receives [6,6,9,9,9]. Why does its result not establish the usual exactly-one-singleton premise?

Select one answer.

3. What is the bitwise AND of every integer from 10 through 13?
4. The test n & (n-1) == 0 is used to recognize positive powers of two. Which additional guard is required?

Select one answer.

5. For a=2 (010), b=4 (100), c=1 (001), how many individual input-bit flips make a OR b equal c?

Select one answer.

Join Discord