Description
https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/description/
Code
This is a cliche question, we can use recursion to solve it, each time we will check the left child and right child, if each ancestor is not null, the current node must be the LCA, else return the non-null node.
1 | /** |