Cognizant Interview Question

To print the duplicate elements in a given string?