Amazon interview question

remove string duplicate