We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d2eb052 commit 34c562bCopy full SHA for 34c562b
2025/day01/solution.py
@@ -0,0 +1,33 @@
1
+with open("input") as f:
2
+ inp = f.read().strip().split("\n")
3
+
4
5
+# Part 1
6
+dial, c = 50, 0
7
+for line in inp:
8
+ dir_ = line[0]
9
+ n = int(line[1:])
10
+ if dir_ == "R":
11
+ dial += n
12
+ else:
13
+ dial -= n
14
+ dial = dial % 100
15
+ c += (dial == 0)
16
17
+print(c)
18
19
20
+# Part 2
21
22
23
24
25
+ for _ in range(n):
26
27
+ dial += 1
28
29
+ dial -= 1
30
31
32
33
0 commit comments