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 pricingFind where the ancestor chains of two nodes first meet when every node has a pointer to its parent.
What this asks
Find where the ancestor chains of two nodes first meet when every node has a pointer to its parent.
Bring both nodes to the same depth by climbing the deeper one, then climb them together until the two pointers agree.
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