C++ 0ms shortest code
\nclass Solution {\npublic:\n    string removeOuterParentheses(string S) {\n        stack<char> st;\n        string ans;\n        for(char c: S)\n        {\n   
```\nclass Solution {\npublic:\n    string removeOuterParentheses(string S) {\n        stack<char> st;\n        string ans;\n        for(char c: S)\n        {\n            if(c == \')\') st.pop();\n            if(!st.empty()) ans += c;\n            if(c == \'(\') st.push(c);\n        }\n        return ans;\n    }\n};\n```
['Stack', 'C']