My Advent of Code solutions in Python. kevinyap.ca/2019/12/going-fast-in-advent-of-code/
advent-of-code python
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 17 lines 375 B view raw
1import fileinput 2 3floor = 0 4basement = None 5 6for line in fileinput.input(): 7 for i, char in enumerate(line, start=1): 8 if char == "(": 9 floor += 1 10 elif char == ")": 11 floor -= 1 12 13 if floor == -1 and basement is None: 14 basement = i 15 16print "Santa's floor: %d" % floor 17print "Entered basement at character %d" % basement