Dictionary contains duplicates


#1

Remove the duplicates and sort the dictionary first.