Problem 1650 · Medium

Lowest Common Ancestor of a Binary Tree III

Two walkers climb parent pointers and switch to the other start at the root; they meet at the LCA.

Open the interactive visualisation