American Express Interview Question

Why is it not good to use recursion here ?