Skip to content

Commit a6f5414

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 89a6392 commit a6f5414

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dynamic_programming/knapsack.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def _construct_solution(dp: list, wt: list, i: int, j: int, optimal_set: set):
136136
wt = [4, 3, 2, 3]
137137
n = 4
138138
w = 6
139-
f = [[0] * (w + 1)] + [[0] + [-1] *(w + 1) for _ in range(n + 1)]
139+
f = [[0] * (w + 1)] + [[0] + [-1] * (w + 1) for _ in range(n + 1)]
140140
optimal_solution, _ = knapsack(w, wt, val, n)
141141
print(optimal_solution)
142142
print(mf_knapsack(n, wt, val, w)) # switched the n and w

0 commit comments

Comments
 (0)