ZenTrades interview question

Machine coding on React (Recursive problem statement)