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.
12345678910111213141516 |
- #!/usr/bin/python
-
- with open('1.txt', 'r') as file:
- input = file.read()
-
- floor = 0
- position = 1
-
- while True:
- floor += 1 if input[position - 1] == '(' else -1
-
- if floor < 0:
- print('Position %s' % position)
- break
-
- position += 1
|