Pregunta de entrevista de Amazon

A difficult question about binary trees