Skip to content

Commit 7320ab9

Browse files
committed
Advent of Code: simplify 2025/06 p1
1 parent bcca909 commit 7320ab9

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

advent_of_code/2025/d06.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
123 328 51 64
77
45 64 387 23
88
6 98 215 314
9-
* + * +"""
9+
* + * + """
1010

1111

1212
class Day06(aoc.Challenge):
@@ -20,12 +20,10 @@ class Day06(aoc.Challenge):
2020

2121
def part1(self, puzzle_input: str) -> int:
2222
"""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)
23+
words = [line.split() for line in puzzle_input.splitlines()]
2624
return sum(
27-
aoc.LIST_OPS[op](nums)
28-
for nums, op in zip(transposed, operators)
25+
aoc.LIST_OPS[op](int(i) for i in nums)
26+
for *nums, op in zip(*words)
2927
)
3028

3129
def part2(self, puzzle_input: str) -> int:

0 commit comments

Comments
 (0)