3 ms·
FWIW the Counter line can be simplified slightly: cnt = Counter(n.strip() for n in sys.stdin) * no need for a list comprehension, a generator expression w
by masklinn 10y ago
FWIW the Counter line can be simplified slightly:
cnt = Counter(n.strip() for n in sys.stdin)
* no need for a list comprehension, a generator expression will do
* file objects are iterable, and iterated line-wise