Update readme and lib and start 2015.

This commit is contained in:
2024-01-27 22:56:28 -05:00
parent b88d839bc1
commit d32bd4c04b
9 changed files with 181 additions and 6 deletions

22
2015/d1.py Normal file
View File

@@ -0,0 +1,22 @@
from lib import *
data = open(0).read()
part_2 = True
floor = 0
for i, c in enumerate(data):
if c == "(":
floor += 1
elif c == ")":
floor -= 1
else:
print(c)
assert False
if part_2 and floor == -1:
print(i + 1)
break
if not part_2:
print(floor)