C#
\npublic string RemoveOuterParentheses(string S) {\n\tvar str = new StringBuilder();\n\tvar i = 0;\n\n\tforeach (var c in S.ToCharArray()) {\n\t\ti += c == \'(\
```\npublic string RemoveOuterParentheses(string S) {\n\tvar str = new StringBuilder();\n\tvar i = 0;\n\n\tforeach (var c in S.ToCharArray()) {\n\t\ti += c == \'(\' ? 1 : -1;\n\n\t\tif (c == \'(\' && i > 1 || c == \')\' && i > 0)\n\t\t\tstr.Append(c);\n\t}\n\n\treturn str.ToString();\n}\n```
[]