Change directory structure.

This commit is contained in:
Bert Peters
2015-12-09 11:20:40 +01:00
parent 7e1e33c0ba
commit 1178d7eac1
18 changed files with 0 additions and 0 deletions

17
day-01/solution.py Normal file
View File

@@ -0,0 +1,17 @@
import fileinput
floor = 0
seenBasement = False
for line in fileinput.input():
for idx, c in enumerate(line.strip()):
if c == '(':
floor += 1
else:
floor -= 1
if not seenBasement and floor == -1:
seenBasement = True
print "Basement reached at", idx + 1
print "Finally arrived at", floor