ByteDance interview question

Remove duplicates in an array