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 pricingCount the k item subsets by filtering masks with bitCount.
What this asks
Count how many subsets of n items have exactly k items.
Filter all 2^n masks by bitCount, or build the counts with Pascal's rule when n is large.
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