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 nodes that have at least one child.
What this asks
Count the nodes that have at least one child.
The same walk with a different rule: a leaf returns 0, and a node with at least one child returns 1 plus its children's counts.
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