Question d’entretien chez Google

Leetcode hard, a novel tree problem.