add: day01: part

This commit is contained in:
2025-12-01 12:36:26 +01:00
parent 0885af7f06
commit d5ba743679

17
2025/day01/part1.py Normal file
View File

@ -0,0 +1,17 @@
text: str
with open("input.txt") as f:
text = f.read()
total: int = 0
nb: int = 50
text = text.replace("L", "-").replace("R", "+")
for line in text.splitlines():
nb = (nb + int(line)) % 100
if nb == 0:
total += 1
print(total)