Pregunta de entrevista de Amazon

How would you replace duplicate values in an unsorted array?