mirror of
https://github.com/ershisan99/advent-of-code.git
synced 2025-12-17 04:59:27 +00:00
2015 day 1
This commit is contained in:
10
2015/day-1/part-2.py
Normal file
10
2015/day-1/part-2.py
Normal file
@@ -0,0 +1,10 @@
|
||||
input = open("input.txt").read()
|
||||
count = 0
|
||||
for i, char in enumerate(list(input), start=1):
|
||||
if char == "(":
|
||||
count += 1
|
||||
else:
|
||||
if count == 0:
|
||||
print(i)
|
||||
break
|
||||
count -= 1
|
||||
Reference in New Issue
Block a user