Advent of code 2015 solutions https://adventofcode.com/2015/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1.py 258B

12345678910111213141516
  1. #!/usr/bin/python
  2. with open('1.txt', 'r') as file:
  3. input = file.read()
  4. floor = 0
  5. position = 1
  6. while True:
  7. floor += 1 if input[position - 1] == '(' else -1
  8. if floor < 0:
  9. print('Position %s' % position)
  10. break
  11. position += 1