From 5ff222fd10ed41cf8d14a9aef25481079bc2362b Mon Sep 17 00:00:00 2001 From: Matus Tejiscak Date: Tue, 2 Dec 2025 21:06:27 +0100 Subject: [PATCH] Solve task #1. --- 01/input01.txt | 10 ++++++++++ 01/solve.py | 22 ++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 01/input01.txt create mode 100755 01/solve.py 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)