Pregunta de entrevista de Cognizant

To print the duplicate elements in a given string?