r/programming • • Dec 01 '15

Daily programming puzzles at Advent of Code

http://adventofcode.com/
320 Upvotes

179 comments sorted by

View all comments

Show parent comment

1

u/Laodic3an Dec 01 '15 edited Dec 01 '15

This is what I got in python

floors = input()
for i in range(len(floors)):
    if floors[:i].count("(") - floors[:i].count(")") == -1:
        print(i)
        break