Java - Simple - Using Stack & char array
\npublic String removeDuplicates(String S) \n{\n\tStack<Character> stackWithoutDupl = new Stack();\n\n\tfor(char letter : S.toCharArray())\n\t{\n\t\tif(stackWit
```\npublic String removeDuplicates(String S) \n{\n\tStack<Character> stackWithoutDupl = new Stack();\n\n\tfor(char letter : S.toCharArray())\n\t{\n\t\tif(stackWithoutDupl.isEmpty() || stackWithoutDupl.peek() != letter)\n\t\t{\n\t\t\tstackWithoutDupl.push(letter);\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\tstackWithoutDupl.pop();\n\t\t}\n\t}\n\n\tchar[] result = new char[stackWithoutDupl.size()];\n\tfor(int i = result.length -1; i >= 0; i--)\n\t{\n\t\tresult[i] = stackWithoutDupl.pop();\n\t}\n\n\treturn new String(result);\n}\n```
['Java']