Common interview problems like string processing. Remove repeated chars in a string.
Anonym
One naive implementation is using LinkedHashSet, in Java. Add all characters of string in the set and then for every element of the set, add it to StringBuffer and return. Since LinkedHashSet maintains insertion order, if input is "aabcdc", output will be "abcd"