add: day01: part
This commit is contained in:
17
2025/day01/part1.py
Normal file
17
2025/day01/part1.py
Normal 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)
|
||||||
Reference in New Issue
Block a user