Amazon Interview Question

Recursion Q