Help making solution optimal for Bytelandian gold coins problem

problem
my solution

what can i do more to make my solution under time limits ?.

Solution
This worked.

1 Like

thank you very much @lemme_try , i think my solution is going into infinite recursion that’s why it shows time limit exceded. thank you.