Optimal Algorithmic Approach
Post-order DFS: the first node where both subtrees return hits is the LCA.
Core Invariants & Edge Cases
- If current node is p or q, return it
- Recurse left and right; if both return non-null, current node is LCA
- Otherwise return the non-null result