Python Solution


  • 0
    class Solution(object):
        def change(self, amount, coins):
            dic = {0: 1}
            for coin in coins:
                for j in range(amount + 1):
                    dic[j] = dic.get(j, 0) +  dic.get(j - coin, 0)
            return dic.get(amount, 0)
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.