simpler sort-uniq solution