Pregunta de entrevista de S&P Global

repeatedly remove duplicate characters in a string