Virtusa interview question

duplicate elements in a string in java spy number program in java