American Express interview question

Why is it not good to use recursion here ?