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.
2 parents 4598c47 + 01ee8a2 commit 97636ccCopy full SHA for 97636cc
problems/0518.零钱兑换II.md
@@ -243,6 +243,22 @@ func change(amount int, coins []int) int {
243
}
244
```
245
246
+Javascript:
247
+```javascript
248
+const change = (amount, coins) => {
249
+ let dp = Array(amount + 1).fill(0);
250
+ dp[0] = 1;
251
+
252
+ for(let i =0; i < coins.length; i++) {
253
+ for(let j = coins[i]; j <= amount; j++) {
254
+ dp[j] += dp[j - coins[i]];
255
+ }
256
257
258
+ return dp[amount];
259
+}
260
+```
261
262
263
264
-----------------------
0 commit comments