4 ms·
Just for fun, here's a version using `Counter` from the same `collections` module which makes that blissfully simple: #!/usr/bin/env python2 import sys
by heydenberk 11y ago
Just for fun, here's a version using `Counter` from the same `collections` module which makes that blissfully simple:
#!/usr/bin/env python2
import sys
from collections import Counter
for pair in Counter(sys.stdin).most_common():
print pair