We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a9d58b9 commit ae7fd87Copy full SHA for ae7fd87
docs/notes/Leetcode 题解 - 动态规划.md
@@ -912,6 +912,7 @@ return -1.
912
913
```java
914
public int coinChange(int[] coins, int amount) {
915
+ if (amount == 0 || coins == null) return 0;
916
int[] dp = new int[amount + 1];
917
for (int coin : coins) {
918
for (int i = coin; i <= amount; i++) { //将逆序遍历改为正序遍历
notes/Leetcode 题解 - 动态规划.md
0 commit comments