Pregunta de entrevista de InstaWP

Write a program to collect duplicates in a string.