diff --git a/docs/notes/Leetcode 题解 - 动态规划.md b/docs/notes/Leetcode 题解 - 动态规划.md index 6cf5449b..c556ee0f 100644 --- a/docs/notes/Leetcode 题解 - 动态规划.md +++ b/docs/notes/Leetcode 题解 - 动态规划.md @@ -902,6 +902,9 @@ Explanation: there are four ways to make up the amount: ```java public int change(int amount, int[] coins) { + if (amount == 0 || coins == null || coins.length == 0) { + return 0; + } int[] dp = new int[amount + 1]; dp[0] = 1; for (int coin : coins) { @@ -999,8 +1002,7 @@ public int combinationSum4(int[] nums, int target) { 题目描述:交易之后需要有一天的冷却时间。 -

- +

```java public int maxProfit(int[] prices) { diff --git a/docs/pics/ffd96b99-8009-487c-8e98-11c9d44ef14f.png b/docs/pics/ffd96b99-8009-487c-8e98-11c9d44ef14f.png new file mode 100644 index 00000000..b01c1ca0 Binary files /dev/null and b/docs/pics/ffd96b99-8009-487c-8e98-11c9d44ef14f.png differ diff --git a/notes/Leetcode 题解 - 动态规划.md b/notes/Leetcode 题解 - 动态规划.md index 1b36b521..a0a50a4a 100644 --- a/notes/Leetcode 题解 - 动态规划.md +++ b/notes/Leetcode 题解 - 动态规划.md @@ -1002,8 +1002,7 @@ public int combinationSum4(int[] nums, int target) { 题目描述:交易之后需要有一天的冷却时间。 -

- +

```java public int maxProfit(int[] prices) { diff --git a/notes/pics/ffd96b99-8009-487c-8e98-11c9d44ef14f.png b/notes/pics/ffd96b99-8009-487c-8e98-11c9d44ef14f.png new file mode 100644 index 00000000..b01c1ca0 Binary files /dev/null and b/notes/pics/ffd96b99-8009-487c-8e98-11c9d44ef14f.png differ