Pregunta de entrevista de TradingHub

leetcode question relating to tree search.