We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bcca909 commit 7320ab9Copy full SHA for 7320ab9
1 file changed
advent_of_code/2025/d06.py
@@ -6,7 +6,7 @@
6
123 328 51 64
7
45 64 387 23
8
6 98 215 314
9
-* + * +"""
+* + * + """
10
11
12
class Day06(aoc.Challenge):
@@ -20,12 +20,10 @@ class Day06(aoc.Challenge):
20
21
def part1(self, puzzle_input: str) -> int:
22
"""Return the answer for the math homework."""
23
- *lines, operators = [line.split() for line in puzzle_input.splitlines()]
24
- numbers = [[int(i) for i in line] for line in lines]
25
- transposed = zip(*numbers)
+ words = [line.split() for line in puzzle_input.splitlines()]
26
return sum(
27
- aoc.LIST_OPS[op](nums)
28
- for nums, op in zip(transposed, operators)
+ aoc.LIST_OPS[op](int(i) for i in nums)
+ for *nums, op in zip(*words)
29
)
30
31
def part2(self, puzzle_input: str) -> int:
0 commit comments