diff --git a/2025/day03/part2.py b/2025/day03/part2.py new file mode 100644 index 0000000..d2d3d9d --- /dev/null +++ b/2025/day03/part2.py @@ -0,0 +1,21 @@ +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] + result: str = "" + start_index: int = 0 + for i in range(0, 12): + stop_index: int = i - 11 if i != 11 else len(lst) + sublst = lst[start_index:stop_index] + max_value = max(sublst) + result += str(max_value) + start_index = start_index + sublst.index(max_value) + 1 + total += int(result) + + +print(total) \ No newline at end of file