Help with error

code: https://ide.codingblocks.com/s/425420

problem: https://hack.codingblocks.com/app/contests/2022/591/problem

I would like to know the reason there is no output also I’m aware that I need to make changes to submit the code in hackerblocks

Hello @raghav007 you were doing small mistake:
https://ide.codingblocks.com/s/425424
i have corrected the error:
i guess you were just concerned about the error.


there is still no output, yeah just concerned about the error

check now:

but should not the current coin in hand be less than the current amount in order to make change?

@raghav007 make this change:
ways[i] += ways[i - denom[j]]; //it should be denom[j] and not denom[i].


it is showing the right answer now on my sample input

this is the code which is not giving the correct answer on hackerblocks( adaptation of above code)

@raghav007 https://ide.codingblocks.com/s/425748

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.