stack java
If you like it pls upvote\n\n\n    public String removeOuterParentheses(String s) {\n        Stack<Character> st = new Stack<>();\n        StringBuilder sb = ne
If you like it pls upvote\n```\n\n    public String removeOuterParentheses(String s) {\n        Stack<Character> st = new Stack<>();\n        StringBuilder sb = new StringBuilder();\n\n        for (int i = 0; i < s.length(); i++) {\n            if (s.charAt(i) == \'(\') {\n                if (st.size() >= 1) {\n                    sb.append(s.charAt(i));\n                }\n                st.push(s.charAt(i));\n            } else {\n                if (st.size() > 1) {\n                    sb.append(s.charAt(i));\n                }\n                st.pop();\n            }\n        }\n        return sb.toString();\n    }\n\n```
['Stack', 'Java']