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.