Skip to content

Commit 0974ec0

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 605867b commit 0974ec0

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

project_euler/problem_345/sol1.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@
6464
]
6565

6666

67-
def solve(
68-
arr: NDArray, row: int, cols: set[int], cache: dict[str, int]
69-
) -> int:
67+
def solve(arr: NDArray, row: int, cols: set[int], cache: dict[str, int]) -> int:
7068
"""
7169
Finds the max sum for array `arr` starting with row index `row`, and with columns
7270
included in `cols`. `cache` is used for caching intermediate results.
@@ -86,7 +84,8 @@ def solve(
8684
for col in cols:
8785
new_cols = cols - {col}
8886
max_sum = max(
89-
max_sum, arr[row, col] + solve(arr=arr, row=row + 1, cols=new_cols, cache=cache)
87+
max_sum,
88+
arr[row, col] + solve(arr=arr, row=row + 1, cols=new_cols, cache=cache),
9089
)
9190
cache[cache_id] = max_sum
9291
return max_sum

0 commit comments

Comments
 (0)