Problem 3: remove duplicate characters in a string