In one of the questions of “Introductory Challenges” - “Coin Change” where we have to find no of ways to produce a given amount, my Top-Down approach solution keeps on failing on certain test cases. I am unable to debug the code.
Can you help me in identifying the issue?
Coin Change Problem
hey, your approach sort of takes the approach similar to that of greedy way, since it includes or does not include only the mth coin it does not consider all the substructures simultaneously, it can be easily rectified by using bottom up DP or by adding a for loop to consider all the ways at once
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.