Skip to content

Commit a9a3307

Browse files
author
Joseph Luce
authored
Update 322_coin_change.md
1 parent 9d97eaf commit a9a3307

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

leetcode/medium/322_coin_change.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ We can build the minimum coins as we increase the amount by using the previous c
1212
For example, if you have an input of [1,5,7] coins.
1313
The minimum coins for amount 1 and 5 is 1.
1414
When we get to amount 6 with coin 5, we will look at amount 1 (6-5=1) for its minimum coin, which is 1 and do 1+1 at amount 6.
15-
Similarly, when we get to amount 13 with coin 7, we do 13-7=6, look at amount 6 which is 2 minimum coins and do 2+1 for amount 12.
15+
Similarly, when we get to amount 13 with coin 7, we do 13-7=6, look at amount 6 which is 2 minimum coins and do 2+1 for amount 13.
1616
We repeat this until we reach the given amount.
1717

1818
We can do some further optimizations by removing coins that are over the given amount.

0 commit comments

Comments
 (0)