Pergunta de entrevista da empresa Verisign

How to detect duplicates in a list. How to detect nth duplicate in a list.