Advent of code 2015 solutions https://adventofcode.com/2015/
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

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