AdventOfCode/2015/01/part1.py

18 lines
297 B
Python
Raw Normal View History

2024-11-02 18:13:20 +01:00
#!/bin/python3
import sys
from pprint import pprint
input_f = sys.argv[1]
result = 0
with open(input_f) as file:
for line in file:
for idx,i in enumerate(line):
if i == '(':
result += 1
if i == ')':
result -= 1
print(result)