Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- s = input()
- cnt = 0
- psp = []
- for i in range(len(s)):
- if s[i] == '(' or s[i] == '[' or s[i] == '{':
- psp.append(s[i])
- else:
- if len(psp) > 0 and psp[-1] == s[i]:
- psp.pop()
- else:
- print("hui sosi")
- exit()
- if len(psp) > 0:
- print("hui sosi")
- else:
- print("ne sosi")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement