python3 40ms beas 93%
time complexity : O(n)\n\nclass Solution:\n    def removeOuterParentheses(self, S: str) -> str:\n        if len(S) <= 2:\n            return ""\n        \n     
time complexity : O(n)\n```\nclass Solution:\n    def removeOuterParentheses(self, S: str) -> str:\n        if len(S) <= 2:\n            return ""\n        \n        ans = ""\n        count = 0\n        for c in S:\n            if c == "(":\n                count += 1\n                if count > 1:\n                    ans += c\n            else:\n                count -= 1\n                if count > 0:\n                    ans += c\n        \n        return ans\n```
[]