Meta asks LCA problems regularly to test your recursive tree reasoning.
Given a binary tree and nodes p and q, find their lowest common ancestor (LCA). The LCA is the deepest node that has both p and q as descendants. A node counts as a descendant of itself.
For tree [3,5,1,6,2,0,8,null,null,7,4] with p=5 and q=1, the LCA is 3.
Constraints: . All node values are unique. p and q exist in the tree and p != q.