commit 5ff222fd10ed41cf8d14a9aef25481079bc2362b Author: Matus Tejiscak Date: Tue Dec 2 21:06:27 2025 +0100 Solve task #1. diff --git a/01/input01.txt b/01/input01.txt new file mode 100644 index 0000000..53287c7 --- /dev/null +++ b/01/input01.txt @@ -0,0 +1,10 @@ +L68 +L30 +R48 +L5 +R60 +L55 +L1 +L99 +R14 +L82 diff --git a/01/solve.py b/01/solve.py new file mode 100755 index 0000000..a229e77 --- /dev/null +++ b/01/solve.py @@ -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)