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 a4235e0 commit 583ffe6Copy full SHA for 583ffe6
src/others/min-coins-change.js
@@ -28,11 +28,9 @@
28
return [change];
29
}
30
for (var i = 1; i <= change; i += 1) {
31
- var current = null;
32
for (var j = 0; j < coins.length && coins[j] <= change; j += 1) {
33
for (var k = 0; k < minChange.length; k += 1) {
34
- if (k + coins[j] === i &&
35
- (!current || minChange[k].length + 1 < current.length)) {
+ if (k + coins[j] === i) {
36
minChange[i] = minChange[k].concat([coins[j]]);
37
38
0 commit comments