Given a binary tree and two node values, return the value of their lowest common ancestor.
Examples
Input:[[3,5,1,6,2,0,8,null,null,7,4],5,1]
Output:
Input:[[3,5,1,6,2,0,8,null,null,7,4],5,4]
Output:
Hints
If the current node is null, return null.
If the current node's value matches either p or q, return the current node.
Recursively search for p and q in the left and right subtrees. If both subtrees return non-null values, the current node is the LCA. Otherwise, return the non-null subtree result.