Skip to content

Commit 4da0ed4

Browse files
joshua-dierickse-altiWolf22
authored andcommitted
Time: 199 ms (62.73%) | Memory: 17.8 MB (98.35%) - LeetSync
Co-authored-by: Joshua Dierickse <[email protected]>
1 parent 1651dac commit 4da0ed4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class Solution:
2+
def change(self, amount: int, coins: List[int]) -> int:
3+
dp = [0] * (amount + 1)
4+
dp[0] = 1
5+
6+
for i in range(len(coins)):
7+
for j in range(len(dp) - coins[i]):
8+
dp[coins[i] + j] += dp[j]
9+
return dp[-1]
10+
11+

0 commit comments

Comments
 (0)