Citadel Interview Question

Leetcode easy question for trees