Pregunta de entrevista de Quorum

How to remove duplicates from an array How can we optimize it?