Zillow Interview Question

Tree manipulation problem