Learn
Practice
Newsletter
Resources
Animations
New
F
Toggle theme
0
F
0
Toggle menu
← Back to All Animations
Coin Change II
Bookmark
O(n × amount) Space
O(amount) Space
Input
Example 1
Example 2 (odd)
Example 3 (exact)
Example 4
Example 5
Custom
amount
=
5
,
coins
=
[1, 2, 5]
coins
1
2
5
amount =
5
amount j
0
1
2
3
4
5
coins used
-
+1
+2
+5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
how many coin combinations make 5? order does not matter
algo
master
.
io
Step:
How many combinations of coins make 5?
0 / 31
Input
Example 1
Example 2 (odd)
Example 3 (exact)
Example 4
Example 5
Custom
amount
=
5
,
coins
=
[1, 2, 5]
0 / 31
coins
1
2
5
amount =
5
amount j
0
1
2
3
4
5
coins used
-
+1
+2
+5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
how many coin combinations make 5? order does not matter
algo
master
.
io
Step:
How many combinations of coins make 5?