New York Times interview question

Remove duplicates from an array