Uber Interview Question

Leetcode hard related to trees