Clarivate interview question

Remove duplicates in an array without extra space