Adobe interview question

Lowest Common Ancestor (LeetCode Medium)