Amazon Interview Question

Question based on LCA of a binary tree