sol: https://ide.codingblocks.com/s/420288
prob: https://leetcode.com/problems/coin-change-2/
please tell what is wrong here
sol: https://ide.codingblocks.com/s/420288
prob: https://leetcode.com/problems/coin-change-2/
please tell what is wrong here
Hello @raghav007 i have made correction:
but still it will not pass all the test cases: Because TLE you have to now memoise it.
and please dont be in the habbit of raising the doubt on the same content for different for different questions.
Can you please explain the significance of variable k, I’m not able to understand
@raghav007 i have added k because everytime you are checking with starting of the loop so for the given test cases smaller coins are being added and you ans variable was incremented for larger number of times rather then adding if any biggere coin can also lead you to the result.
thats why i have added k as to start from where you have called.
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.