class Solution:
    def change(self, amount: int, coins: List[int]) -> int:
        i = 0
        while i<len(coins):
            if coins[i] > amount:
                coins.pop(i)
                i -= 1
            i += 1    
        dp = [[0 for _ in range(amount+1)] for _ in range(len(coins)+1)]
        for i in range(len(coins)+1):
            dp[i][0] = 1
        for i in range(1,len(coins)+1):
            for j in range(1,amount+1):
                dp[i][j] = dp[i-1][j] + dp[i][j-coins[i-1]]          
        return(dp[-1][-1])