

def find_top_N_recurring_words(seq, N):
    ' find the top N recurring words in a file:\n        1) use a hash table to find counts\n        2) sort the list on base of the maximum counts\n        3) return the last N words\n    '
    dcounter = Counter()
    for word in seq.split():
        dcounter[word] += 1
    return dcounter.most_common(N)

dataset/ETHPy150Open bt3gl/Python-and-Algorithms-and-Data-Structures/src/builtin_structures/find_top_N_recurring_words.py find_top_N_recurring_words/original