0%
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| class Solution: def change(self, amount: int, coins: List[int]) -> int: d = [0 for _ in range(amount+1)] d[0] = 1 for i in range(len(coins)): for j in range(coins[i],amount+1): d[j] += d[j-coins[i]] return d[amount]
|