Lowest Common Ancestor of a Binary Tree (LC #236) appears constantly at Meta. The idea: if both target nodes are in different subtrees, the current node is the LCA. Recursively search left and right subtrees. If both return non-null, current is LCA. If only one returns non-null, propagate it up. Base case: return the node if it matches either target or is null. This runs in time and space where is height. Meta asks follow-ups about BSTs where you can use value comparisons.
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
$ curl repovive.com/roadmaps/meta-interview-prep/trees/lowest-common-ancestor-of-a-binary-tree
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██████████████████████████████████████████████████████████████████████████████████████████████