Skip to content

Commit a70d456

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

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

knapsack/recursive_approach_knapsack.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111
profit[i] >= 0
1212
weight[i] >= 0
1313
14-
Calculate the maximum profit the shopkeeper can make given the maximum weight
14+
Calculate the maximum profit the shopkeeper can make given the maximum weight
1515
that can be carried.
1616
"""
1717

18+
1819
def knapsack(
1920
weights: list, values: list, number_of_items: int, max_weight: int, index: int
2021
) -> int:
@@ -41,7 +42,7 @@ def knapsack(
4142
ans2 = values[index] + knapsack(
4243
weights, values, number_of_items, max_weight - weights[index], index + 1
4344
)
44-
45+
4546
return max(ans1, ans2)
4647

4748

0 commit comments

Comments
 (0)