From bba8b340d0dac1f087f0f1bb09fcb3e0de8663cc Mon Sep 17 00:00:00 2001 From: Starnakin Date: Wed, 3 Dec 2025 12:16:57 +0100 Subject: [PATCH] add: day03: part1 --- 2025/day03/part1.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 2025/day03/part1.py diff --git a/2025/day03/part1.py b/2025/day03/part1.py new file mode 100644 index 0000000..b11d8cf --- /dev/null +++ b/2025/day03/part1.py @@ -0,0 +1,17 @@ +import math +text: str + +with open("input.txt") as f: + text = f.read() + +total: int = 0 + +for line in text.splitlines(): + lst = [int(char) for char in line] + first_max_value = max(lst[:-1]) + first_max_index = lst.index(first_max_value) + second_max_value = max(lst[first_max_index + 1:]) + total += first_max_value * 10 + second_max_value + + +print(total) \ No newline at end of file