Question d’entretien chez Amazon

same tree leetcode question (easy)