Google interview question

Phone interview. Solve Tree problem and array