Capital One Interview Question

Binary tree question on leetcode