Pregunta de entrevista de Amazon

tree traversal - leetcode medium to hard question