Skip to content

Commit 05d92c0

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 06edbaf commit 05d92c0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Diff for: greedy_methods/fractional_knapsack.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ def frac_knapsack(
4848
"""
4949

5050
# sort in descending order of value/weight ratio
51-
r = sorted(zip(values, weights),
52-
key=lambda x: x[0] / x[1], reverse=True)
51+
r = sorted(zip(values, weights), key=lambda x: x[0] / x[1], reverse=True)
5352

5453
values, weights = [i[0] for i in r], [i[1] for i in r] # unzip the list
5554
acc = list(accumulate(weights)) # cumulative sum of weights

0 commit comments

Comments
 (0)