MapsExercise.go This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters Show hidden characters package main import ( "golang.org/x/tour/wc" "strings" ) func WordCount ( s string ) map [ string ] int { a := strings . Fields ( s ) m := make ( map [ string ] int ) for _ , element := range a { m [ element ] += 1 } return m } func main () { wc . Test ( WordCount ) }

Tour of Golang | Exercise: Maps - https://tour.golang.org/moretypes/23
Akshay Kumar


