Go(golang) solution
\n# Complexity\n- Time complexity:\n Add your time complexity here, e.g. O(n) \n\n- Space complexity:\n Add your space complexity here, e.g. O(n) \n\n# Code\n\n
\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nfunc removeOuterParentheses(s string) string {\n    var result string\n    var index int\n\n    for _, x := range s {\n        switch x {\n        case \'(\':\n            if index > 0 {\n                result += string(x)\n            }\n            index++\n        case \')\':\n            index--\n            if index > 0 {\n                result += string(x)\n            }\n        }\n    }\n\n    return result\n}\n\n```
['Array', 'Go']