From f6b7a1fb011a3dae5de7eefd3b7c3d41e6a0957c Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sun, 22 Dec 2024 19:55:32 +0100 Subject: Rename function --- 2024/22/puzzles.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/2024/22/puzzles.py b/2024/22/puzzles.py index dff825f..aa62086 100644 --- a/2024/22/puzzles.py +++ b/2024/22/puzzles.py @@ -12,7 +12,7 @@ def main() -> None: xs = map(int, f.readlines()) # START PART 1 - print(sum(map(lastfrom, map(secrets, xs)))) + print(sum(map(takelast, map(secrets, xs)))) # END PART 1 START PART 2 sums = collections.defaultdict(int) for x in xs: @@ -51,7 +51,7 @@ def lastdigit(n: int) -> int: return n % 10 -def lastfrom[T](xs: Iterable[T]) -> T: +def takelast[T](xs: Iterable[T]) -> T: *_, x = xs return x -- cgit v1.2.3