Google Interview Question

Phone interview. Solve Tree problem and array