This theory is part of Premium
The full write-up (worked counting examples, the trap list and the interview playbook) unlocks with a Premium plan, along with every Pro visualizer.
See pricingReport whether position k of a number is on.
What this asks
Report whether bit k of a number is on.
(x & (1 << k)) != 0: one mask, one test.
The full write-up (worked counting examples, the trap list and the interview playbook) unlocks with a Premium plan, along with every Pro visualizer.
See pricing