Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- s = input()
- balance = 0
- for i in range(len(s)):
- if s[i] == '(':
- balance +=1
- else:
- balance -=1
- if balance <0:
- break
- if balance == 0:
- print("ALLRIGHT")
- else:
- print("WRONG")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement