Question d’entretien chez Bloomberg

Some binary tree problem, original LC problem.