Duplicates and Non Duplicates

Please provide the best way to do this