TradingHub Interview Question

leetcode question relating to tree search.