Amazon interview question

Example dataset, look at duplicates