Domanda di colloquio di Amazon

Leet code medium problem which required knowledge of trees