Javascript beats 99.26% easy to understand
\nvar removeOuterParentheses = function(S) {\n    let result = \'\';\n    let open = 0\n    for (let i = 0; i < S.length; i++) {\n        if (S[i] === \'(\') {\
```\nvar removeOuterParentheses = function(S) {\n    let result = \'\';\n    let open = 0\n    for (let i = 0; i < S.length; i++) {\n        if (S[i] === \'(\') {\n            if (open > 0) { \n\t\t\t\tresult += \'(\';\n\t\t\t}\n\t\t\topen++;\n        } else if (S[i] === \')\') {\n            if (open > 1) { \n\t\t\t\tresult += \')\'; \n\t\t\t}\n\t\t\topen--;\n        }\n    }\n    return result;\n};\n```
[]