[Java] Easy Solution || Using Stack || Faster than 60%
\nclass Solution {\n    public String removeDuplicates(String s) {\n        Stack<Character> st = new Stack<>();\n        for(int i = 0; i < s.length() ;i++){\n
```\nclass Solution {\n    public String removeDuplicates(String s) {\n        Stack<Character> st = new Stack<>();\n        for(int i = 0; i < s.length() ;i++){\n            if(!st.isEmpty()){\n                if(st.peek() == s.charAt(i)){\n                    st.pop();\n                }else{\n                    st.push(s.charAt(i));\n                }\n            }else{\n                st.push(s.charAt(i));\n            }\n        }\n        StringBuilder ns = new StringBuilder("");\n        while(!st.isEmpty()){\n            ns.append(st.pop());\n        }\n        return ns.reverse().toString();\n    }\n}\n```\n\n**upvote please
['String', 'Stack', 'Java']