class Solution(object):
def change(self, amount, coins):
"""
:type amount: int
:type coins: List[int]
:rtype: int
"""
res=[0]*(amount+1)
res[0]=1
for c in coins:
for j in range(1,amount+1):
if j>=c:
res[j]=res[j]+res[j-c]
return res[amount]
# print Solution().change(amount = 5, coins = [1, 2, 5])