Skip to content

Commit ae7fd87

Browse files
committed
auto commit
1 parent a9d58b9 commit ae7fd87

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

docs/notes/Leetcode 题解 - 动态规划.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -912,6 +912,7 @@ return -1.
912912

913913
```java
914914
public int coinChange(int[] coins, int amount) {
915+
if (amount == 0 || coins == null) return 0;
915916
int[] dp = new int[amount + 1];
916917
for (int coin : coins) {
917918
for (int i = coin; i <= amount; i++) { //将逆序遍历改为正序遍历

notes/Leetcode 题解 - 动态规划.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -912,6 +912,7 @@ return -1.
912912

913913
```java
914914
public int coinChange(int[] coins, int amount) {
915+
if (amount == 0 || coins == null) return 0;
915916
int[] dp = new int[amount + 1];
916917
for (int coin : coins) {
917918
for (int i = coin; i <= amount; i++) { //将逆序遍历改为正序遍历

0 commit comments

Comments
 (0)