my code isnt woking for all the testcases.

hello @Kush_1312
u have not generalised ur code.

but its not wroking for the the coins={1,7,10}

its the same code as in the video and its giving me wrong output for cases like 5,21

it is working fine.
for n=5 output should be 5 and ur code is also giving 5 {1,1,1,1,1}.
for n=21 output should be 3 and ur code is also giving 3 {1,10,10} or {7,7,7}.

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.