Given the root and two nodes in a binary tree. Find the lowest common ancestor(LCA) of the two nodes.
The lowest common ancestor is the node with largest depth which is the ancestor of both nodes.
Note that the binary tree does not have to be a binary search tree. Assume both nodes exist in the tree.
4 LCA(3, 5) = 4
/ \ LCA(5, 6) = 7
3 7 LCA(6, 7) = 7
Recursive depth-first search solution: