From e688c2b674fc7ad6a964a48df379e5abd01843a7 Mon Sep 17 00:00:00 2001 From: Tom van der Lee Date: Mon, 4 Dec 2023 10:40:34 +0100 Subject: Day4 --- day1/__init__.py | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'day1/__init__.py') diff --git a/day1/__init__.py b/day1/__init__.py index ee66fd3..ea27c01 100644 --- a/day1/__init__.py +++ b/day1/__init__.py @@ -10,10 +10,7 @@ class Assignment(BaseAssignment, ABC): def run(self, input: Iterator[list[int]]) -> int: input = list(input) print(input) - return sum([ - int(f'{item[0]}{item[-1]}') - for item in input - ]) + return sum([int(f"{item[0]}{item[-1]}") for item in input]) class AssignmentOne(Assignment): @@ -53,18 +50,8 @@ class AssignmentTwo(Assignment): numbers[index] = int(i) return [ - value - for key, value - in sorted( - numbers.items(), - key=lambda item: item[0] - ) + value for key, value in sorted(numbers.items(), key=lambda item: item[0]) ] def parse_item(self, item: str) -> list[int]: return self._parse_item(item) - - - - - -- cgit v1.2.3