I am trying to solve this problem https://www.hackerrank.com/challenges/coin-change/problem I am getting WA on 8 testcases , but am not able to point out my mistake . My dp state seems fine to me. Can someone please help me find my mistake in this code . Thanks in advance :) Link to my code https://ideone.com/WpjdKJ
Let's look at the constraints:
1 < = n < = 250
I looked at your code but your code prepared only dp[280][100]. Since n < 250 and m < 50, you should prepare dp[100][280]. Otherwise, it will be wrong answer or runtime error.
Thanks friend , very silly of me :P