exercism/go/parallel-letter-frequency/frequency.go

12 lines
141 B
Go
Raw Normal View History

2016-08-13 23:20:14 +00:00
package letter
type FreqMap map[rune]int
func Frequency(s string) FreqMap {
m := FreqMap{}
for _, r := range s {
m[r]++
}
return m
}