Domanda di colloquio di Amazon

some medium-difficulty binary tree problem