diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-12-22 19:55:32 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-12-22 19:55:32 +0100 |
commit | f6b7a1fb011a3dae5de7eefd3b7c3d41e6a0957c (patch) | |
tree | e049d8b60d6d1a4ba6b618661f849e09c1869f14 /2024/22/puzzles.py | |
parent | a82498c4141728069d80418e26196193c451a1cd (diff) |
Diffstat (limited to '2024/22/puzzles.py')
-rw-r--r-- | 2024/22/puzzles.py | 4 |
1 files 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 |