[Python] Simple O(n) solution - beats 97%
python\ndef removeOuterParentheses(self, S):\n\tres = []\n\tbalance = 0\n\ti = 0\n\tfor j in range(len(S)):\n\t\tif S[j] == "(":\n\t\t\tbalance += 1\n\t\telif S
```python\ndef removeOuterParentheses(self, S):\n\tres = []\n\tbalance = 0\n\ti = 0\n\tfor j in range(len(S)):\n\t\tif S[j] == "(":\n\t\t\tbalance += 1\n\t\telif S[j] == ")":\n\t\t\tbalance -= 1\n\t\tif balance == 0:\n\t\t\tres.append(S[i+1:j])\n\t\t\ti = j+1\n\treturn "".join(res)\n```
[]