Write Tally(word) to return a map of how many times each character (spaces too) appears.
Tally("pop")→{'o': 1, 'p': 2}Tally("")→{}func Tally(word string) map[string]intpackage main
func Tally(word string) map[string]int {
count := map[string]int{}
for _, r := range word {
// your code here: add 1 to this character's count (the key: string(r))
}
return count
}
Run tries the examples. When they look right, Submit.