Shortest Python Solution
\nclass Solution:\n    def removeOuterParentheses(self, S: str) -> str:\n        cnt, res = 0, \'\'\n        for c in S:\n            if c == \')\': cnt -= 1  \
```\nclass Solution:\n    def removeOuterParentheses(self, S: str) -> str:\n        cnt, res = 0, \'\'\n        for c in S:\n            if c == \')\': cnt -= 1  \n            if cnt != 0: res += c \n            if c == \'(\': cnt+=1    \n        return res\n```            \n
['Python', 'Python3']