Skip to content

Commit c573210

Browse files
🐛 fix(integerValuesKnapsack): Make it work for any weight type.
1 parent d8315c4 commit c573210

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/integerValuesKnapsack.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const integerValuesKnapsack = (
77
n,
88
W,
99
V = sum(v),
10-
m = new w.constructor(V + 1).fill(Number(Infinity)),
10+
m = new w.constructor(V + 1).fill(W + 1),
1111
) => {
1212
assert(v.length === n);
1313
assert(w.length === n);

0 commit comments

Comments
 (0)