You are viewing a single comment's thread. Return to all comments →
def getWays(n, c): ways = [0] * (n + 1) ways[0] = 1 for coin in c: for i in range(coin, n + 1): ways[i] += ways[i - coin] return ways[n]
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
The Coin Change Problem
You are viewing a single comment's thread. Return to all comments →