Word frequency

FCC link

Given a text string and an integer n, return the n most common words in the file (and the number of their occurrences) in decreasing frequency.

Test

{{test}}

Console output