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)