Skip to content

Commit aa5f336

Browse files
committed
fix: formatting and linting
1 parent 20af921 commit aa5f336

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

_2025/solutions/day06.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ def part1(self, data: list[str]) -> int:
4040
-------
4141
int: Sum of all evaluated math problems from the worksheet
4242
"""
43-
cols = list(zip(*[row.strip().split() for row in data]))
43+
cols = list(zip(*[row.strip().split() for row in data], strict=False))
4444
score = 0
4545

4646
for group in cols:
4747
nums, operator = group[:-1], group[-1]
48-
score += eval(operator.join(nums))
48+
score += eval(operator.join(nums)) # noqa: S307
4949

5050
return score
5151

@@ -73,7 +73,7 @@ def part2(self, data: str) -> int:
7373
problems = []
7474
current_problem = []
7575

76-
for col in zip(*[line[::-1] for line in lines]):
76+
for col in zip(*[line[::-1] for line in lines], strict=False):
7777
if all(char == " " for char in col):
7878
continue
7979

@@ -88,7 +88,9 @@ def part2(self, data: str) -> int:
8888
problems.append(current_problem)
8989
current_problem = []
9090

91-
return sum([
92-
(math.prod(problem) if operator == "*" else sum(problem))
93-
for operator, problem in zip(operators, problems)
94-
])
91+
return sum(
92+
[
93+
(math.prod(problem) if operator == "*" else sum(problem))
94+
for operator, problem in zip(operators, problems, strict=False)
95+
]
96+
)
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
123 328 51 64
2-
45 64 387 23
1+
123 328 51 64
2+
45 64 387 23
33
6 98 215 314
4-
* + * +
4+
* + * +

_2025/tests/test_06.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
1. Part 1: Evaluating each vertically aligned problem using the given operator
77
2. Part 2: Evaluating rotated worksheet problems with column-based parsing
88
"""
9+
910
from aoc.models.tester import TestSolutionUtility
1011

1112

0 commit comments

Comments
 (0)