Question d’entretien chez Google

Phone interview. Solve Tree problem and array