Learned to removed duplicates in a string in place