Tech Mahindra interview question

Remove duplicates from an array