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 pricingCarry the largest value seen on the path down so each node can test itself against it.
What this asks
Count the nodes that are at least as large as every node above them.
Carry the largest value seen on the path down as a second argument; a node that meets the bar is good, and the bar then updates.
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