Problem 1676 · Medium

Lowest Common Ancestor of a Binary Tree IV

Search stops at each supplied node; a node whose two sides both report a target is the shared ancestor.

Open the interactive visualisation