Simple Go and Java solutions
Java:\n\n\npublic String removeOuterParentheses(String S) {\n\tStringBuilder s = new StringBuilder();\n\tStack<Character> h = new Stack<>();\n\n\tfor (int i = 0
Java:\n\n```\npublic String removeOuterParentheses(String S) {\n\tStringBuilder s = new StringBuilder();\n\tStack<Character> h = new Stack<>();\n\n\tfor (int i = 0; i < S.length(); i++) {\n\t\tif (h.size() == 1 && S.charAt(i) == \')\'){\n\t\t\th.pop();\n\t\t\tcontinue;\n\t\t}\n\t\telse if (h.size() == 0 && S.charAt(i) == \'(\'){\n\t\t\th.push(\'(\');\n\t\t}\n\t\telse if (S.charAt(i) == \')\'){\n\t\t\ts.append(")");\n\t\t\th.pop();\n\t\t}\n\t\telse if (S.charAt(i) == \'(\'){\n\t\t\ts.append("(");\n\t\t\th.push(\'(\');\n\t\t}\n\t}\n\treturn s.toString();\n}\n```\n\nGolang:\n\n```\nfunc removeOuterParentheses(S string) string {\n\ts := ""\n\th := []string{}\n\n\tfor _, i2 := range S {\n\t\tif string(i2) == "(" {\n\t\t\tif len(h) != 0 {\n\t\t\t\ts += "("\n\t\t\t}\n\t\t\th = append(h, "(")\n\t\t} else {\n\t\t\tif len(h) != 1 {\n\t\t\t\ts += ")"\n\t\t\t}\n\t\t\th = h[:len(h)-1]\n\t\t}\n\t}\n\treturn s\n}\n```
['Java', 'Go']