Amazon Interview Question

Example dataset, look at duplicates