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 da5a28e commit fee7b25Copy full SHA for fee7b25
src/integerKnapsack.js
@@ -1,6 +1,6 @@
1
import assert from 'assert';
2
3
-const integerKnapsack = (v, w, n, W, m = new w.constructor(W + 1).fill(0)) => {
+const integerKnapsack = (v, w, n, W, m = new v.constructor(W + 1).fill(0)) => {
4
assert(v.length === n);
5
assert(w.length === n);
6
assert(Number.isInteger(W) && W >= 0);
0 commit comments