SHARE
TWEET

Untitled

a guest Feb 20th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. func WordCount(s string) map[string]int {
  2.     fmt.Println(s)
  3.     slice := strings.Split(s, " ")
  4.     fmt.Printf("%q\n", slice)
  5.     wordcount := make(map[string]int)
  6.    
  7.     for _,v := range slice{
  8.         wordcount[v] = wordcount[v] + 1
  9.     }
  10.     return wordcount
  11. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top