java easy to understand |using stack & stringBuilder
\nclass Solution {\n    public String minRemoveToMakeValid(String s) {\n        Stack<Integer> st = new Stack<>();\n        StringBuilder ans = new StringBuilde
```\nclass Solution {\n    public String minRemoveToMakeValid(String s) {\n        Stack<Integer> st = new Stack<>();\n        StringBuilder ans = new StringBuilder(s);\n        \n        for(int i=0;i<s.length();i++)\n        {\n            if(s.charAt(i) == \'(\')\n                st.push(i);\n            else if(s.charAt(i) == \')\')\n            {\n                if(st.size() > 0 && s.charAt(st.peek()) == \'(\')\n                    st.pop();\n                else\n                    st.push(i);\n            }\n        }\n        \n        while(st.size()>0)\n            ans.deleteCharAt(st.pop());\n        \n        return ans.toString();\n    }\n}\n```\nPlease upvote if u find my code easy to understand
['Stack', 'Java']