nfreq is a little program that answers the question "who has the most repeated letters in their name?"
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

16 lines
458 B

package main
func (r results) Len() int { return len(r) }
func (r results) Swap(i, j int) { r[i], r[j] = r[j], r[i] }
func (r results) Less(i, j int) bool {
if len(r[i].h) == 0 || len(r[j].h) == 0 {
return false
}
return r[i].h[0].count > r[j].h[0].count
}
func (h histogram) Len() int { return len(h) }
func (h histogram) Swap(i, j int) { h[i], h[j] = h[j], h[i] }
func (h histogram) Less(i, j int) bool {
return h[i].count > h[j].count
}