Word Frequency

Medium · Text Processing · tr · sort · uniq

Problem

words.txt holds words separated by spaces, possibly across several lines.

Print the two most frequent words, most frequent first, in the format uniq -c produces (a right-aligned count, then the word).

Approaches

Related problems

Start free on Cariara · Coding problems · System design studio

Starting Python
No results yet.

          
↑↓ move ↵ open esc close

Labs

Loading labs…

Run with your own input

Starting Python

Loading Python…