From 833478451a23a86f2e4e13085ab9845e5a081c0e Mon Sep 17 00:00:00 2001 From: s-prechtl Date: Tue, 2 Dec 2025 14:21:05 +0100 Subject: [PATCH] feat: day1.2 --- 2025/Day1/src/main.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/2025/Day1/src/main.py b/2025/Day1/src/main.py index 1a6bc32..16a4ea4 100644 --- a/2025/Day1/src/main.py +++ b/2025/Day1/src/main.py @@ -9,13 +9,15 @@ if __name__ == '__main__': for rotation in rotations: print(rotation) - # Convert left to right to avoid negatives - if rotation["direction"] == 'L': - rotation["count"] = TOTAL_CLICKS - rotation["count"] + if rotation['direction'] == 'L': + direction = -1 + else: + direction = 1 - current = (current + rotation["count"]) % TOTAL_CLICKS + for _ in range(rotation['count']): + current = (current + direction) % TOTAL_CLICKS - if current == 0: - count += 1 + if current == 0: + count += 1 print(count)