Very simple java solution using stack
** PLEASE UPVOTE IF U FIND IT USEFULL\n\n\nclass Solution {\n    public String removeDuplicates(String s) {\n        StringBuilder sb = new StringBuilder();\n  
** PLEASE UPVOTE IF U FIND IT USEFULL**\n\n```\nclass Solution {\n    public String removeDuplicates(String s) {\n        StringBuilder sb = new StringBuilder();\n        Stack<Character> stk = new Stack<>();\n        \n        for(int i=0;i<s.length();i++){\n            if(!stk.isEmpty() && stk.peek()==s.charAt(i))\n                stk.pop();\n            else\n                stk.push(s.charAt(i));\n        }\n        \n        for(Character c : stk)\n            sb.append(c);\n        return sb.toString();\n    }\n}\n```\n\n** PLEASE UPVOTE IF U FIND IT USEFULL**
['Stack', 'Java']