Problem 1644 · Medium

Lowest Common Ancestor of a Binary Tree II

One post-order walk returns the candidate ancestor; both targets must be seen, or the answer is null.

Open the interactive visualisation