Kaizen Reporting interview question

Solve this problem with and without recursion