adventofcode/2015/d1/main.py

15 lines
264 B
Python
Raw Permalink Normal View History

2023-06-16 19:21:56 +02:00
count = 0
move = 0
with open("./input", "r") as f:
for c in f.read():
move += 1
if c == '(':
count = count + 1
elif c == ')':
count = count - 1
if count == -1:
break
print(count)
print(move)