// A function to turn a map into a PairList, then sort and return it.
A function to turn a map into a PairList, then sort and return it.
// A function to turn a map into a PairList then sort and return it .
func sortMapByValue(m map[string]int) PairList {
	pp := make(PairList, len(m))
	i := 0
	for k, v := range m {
		pp[i] = Pair{k, v}
	}
	sort.Sort(pp)
	return pp
}
func sortMapByValue ( m map [ string ] int ) PairList { pp := make ( PairList , len ( m ) ) i := 0 for k , v := range m { pp [ i ] = Pair { k , v } } sort . Sort ( pp ) return pp }
A function to turn a map into a PairList, then sort and return it.
A function to turn a map into a PairList then sort and return it .