๐Word Frequency Analyzer LabLAB
Word Frequency Analyzer Lab
In this lab, you will build a word frequency analyzer using a map[string]int.
Your Task
Given the input string:
- Split it into words using
strings.Fields - Count how many times each word appears using a
map[string]int - Print all word counts (any order is fine)
- Print the count for
"the"specifically - Print the total number of unique words
Expected Output
Note: the order of word count lines may differ since Go maps have no guaranteed iteration order. The important values are
the: 2andUnique words: 8.
โ Enter (Mac) ยท Ctrl+Enter (Win/Linux)
โ Enter (Mac) ยท Ctrl+Enter (Win/Linux)