feat: add solution 2025/01

This commit is contained in:
2025-12-01 07:16:36 +01:00
parent 000000003f
commit 000000105f
2 changed files with 26 additions and 0 deletions

View File

View File

@@ -0,0 +1,26 @@
from typing import Any
def part_1_2(input_data) -> Any:
d = 50
c1 = 0
c2 = 0
for line in input_data.splitlines():
dir = 1 if line[0] == "L" else -1
val = int(line[1:])
for _ in range(val):
d = (d + dir) % 100
if d == 0:
c2 += 1
if d == 0:
c1 += 1
return c1, c2
def test_part_1_2(example_data) -> None:
assert part_1_2(example_data) == (3, 6)