Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import tables, strutils
- var wordFrequencies = initCountTable[string]()
- for line in stdin.lines:
- for word in line.split(", "):
- wordFrequencies.inc(word)
- echo "The most frequent word is '", wordFrequencies.largest, "'"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement