2 ms·
Fair enough. import re import sys import collections c = collections.Counter() for line in sys.stdin: words = re.findall('[a-z]+', line.lowe
by mkl 8y ago
Fair enough.
import re
import sys
import collections
c = collections.Counter()
for line in sys.stdin:
words = re.findall('[a-z]+', line.lower())
c.update(words)
for word, count in c.most_common(int(sys.argv[1])):
print(f'{count:>7} {word}')