Problem in a recursive algorithm for a problem.
I do not understand the reason of that wrong verdict, should I convert the recursive function into iterative by using a stack ?