Pregunta de entrevista de Tata Consultancy Services

find duplicate elements in the array