Pregunta de entrevista de Bloomberg

Some binary tree problem, original LC problem.