aoc/2015/01/part1.py

10 lines
183 B
Python
Raw Normal View History

2018-11-29 16:48:25 +00:00
with open('input.txt', 'r') as input:
counter = 0
text = input.readline()
for char in text :
if char == ')':
counter -= 1
elif char == '(':
counter += 1
print (counter)