Pergunta de entrevista da empresa Google

Phone interview. Solve Tree problem and array