The n or k variable should be named for what it contains. Is it something like the minimumCount to show?
How will the code do that? What steps will it take to do the counting?we need to count the repeated words.
Some earlier code used the Collections class's frequency() method? Can that be used?