You are viewing a single comment's thread. Return to all comments →
Keeping it simple :D
n, m = map(int,input().split()) coins = list(map(int,input().split())) dp = [1]+[0]*n for i in range(m): for j in range(coins[i], n+1): dp[j]+=dp[j-coins[i]] print(dp[-1])
Seems like cookies are disabled on this browser, please enable them to open this website
The Coin Change Problem
You are viewing a single comment's thread. Return to all comments →
Keeping it simple :D