I found an answer close to this question but not good enough:
extension Dictionary { func sortedKeysByValue(by com