Find duplicates in a list using set