Program to remove duplicates from a string