Merge branch 'master' of https://github.com/CyC2018/CS-Notes
This commit is contained in:
commit
656c875d96
|
@ -902,9 +902,6 @@ Explanation: there are four ways to make up the amount:
|
||||||
|
|
||||||
```java
|
```java
|
||||||
public int change(int amount, int[] coins) {
|
public int change(int amount, int[] coins) {
|
||||||
if (amount == 0 || coins == null || coins.length == 0) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
int[] dp = new int[amount + 1];
|
int[] dp = new int[amount + 1];
|
||||||
dp[0] = 1;
|
dp[0] = 1;
|
||||||
for (int coin : coins) {
|
for (int coin : coins) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user