Found at last problem of recursion

I have written the code and it runs perfectly on my local machine, but it is not getting submitted on the course portal. What am i doing wrong?

Please share your code by saving it on coding blocks ide.