aoc/2015/01/part1.py
2019-01-02 01:12:02 +00:00

13 lines
250 B
Python

import os
path = os.path.dirname(os.path.abspath(__file__))
with open(path+'/input.txt', 'r') as input:
counter = 0
text = input.readline()
for char in text :
if char == ')':
counter -= 1
elif char == '(':
counter += 1
print (counter)