Code doesnt work

The code is not working for input
coins = {2}
and money = 5

It repeatedly uses a coin of 1 value, which is not even present in the coins array.

I also tried:


which gives me a memory error.

Please let me know what the problem is and how to resolve as I am pretty confused.

hello @rahulrana1998

pls save ur complete code here->

and share its link with me

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.