Clean JavaScript Solution
\n// time O(n) space O(n)\nvar removeOuterParentheses = function(S) {\n    let result = \'\'\n    let level = 0\n    \n    for(const item of S) {\n        if(it
```\n// time O(n) space O(n)\nvar removeOuterParentheses = function(S) {\n    let result = \'\'\n    let level = 0\n    \n    for(const item of S) {\n        if(item === \')\') {\n            level--\n        }\n        if(level >= 1) {\n            result += item                \n        }\n        if(item === \'(\') {\n            level++\n        }\n    }\n    \n    return result\n};\n```
['JavaScript']