Solve task #1.

This commit is contained in:
2025-12-02 21:06:27 +01:00
commit 5ff222fd10
2 changed files with 32 additions and 0 deletions

10
01/input01.txt Normal file
View File

@@ -0,0 +1,10 @@
L68
L30
R48
L5
R60
L55
L1
L99
R14
L82

22
01/solve.py Executable file
View File

@@ -0,0 +1,22 @@
#!/usr/bin/env python3
import sys
position = 50
code = 0
for line in sys.stdin:
line = line.strip()
if line.startswith('L'):
position -= int(line[1:])
elif line.startswith('R'):
position += int(line[1:])
else:
raise Exception('weird line')
position %= 100
if not position:
code += 1
print(code)