Skip to content

Commit fee7b25

Browse files
🐛 fix(integerKnapsack): Use correct default array type for m.
1 parent da5a28e commit fee7b25

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/integerKnapsack.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import assert from 'assert';
22

3-
const integerKnapsack = (v, w, n, W, m = new w.constructor(W + 1).fill(0)) => {
3+
const integerKnapsack = (v, w, n, W, m = new v.constructor(W + 1).fill(0)) => {
44
assert(v.length === n);
55
assert(w.length === n);
66
assert(Number.isInteger(W) && W >= 0);

0 commit comments

Comments
 (0)