Kaizen Reporting Interview Question

Solve this problem with and without recursion