Skip to content

Commit cdfc1e4

Browse files
committed
Did day 1
1 parent efc1bc9 commit cdfc1e4

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

aoc/2025/1/1.vn.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# Advent of code Day 1
2-
# https://adventofcode.com
3-
# 30/11/2025
2+
# https://adventofcode.com/2025/day/1
3+
# 01/12/2025
44

5+
with open("input.txt", "r") as f:
6+
inp = f.readlines()
7+
58

9+
res1, res2 = 0, 0
10+
pointer = 50
11+
n = 0
12+
for row in inp:
13+
row = row.strip()
14+
sens = 1 if row[0] == "R" else -1
15+
n = int(row[1:])
16+
for _ in range(n):
17+
pointer += sens
18+
pointer %= 100
19+
res2 += pointer == 0
20+
res1 += pointer == 0
21+
22+
print(res1, res2)

0 commit comments

Comments
 (0)