Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- info = list(input())
- stack = []
- for x in range(len(info)):
- if info[x] == '(':
- stack.append(x)
- if info[x] == ')':
- start = stack.pop()
- result = info[start:x + 1]
- print(''.join([str(x) for x in result]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement