You are viewing a single comment's thread. Return to all comments →
a really elegant solution
from collections import Counter, OrderedDict class OrderedCounter(Counter, OrderedDict): pass d = OrderedCounter(input() for _ in range(int(input()))) print(len(d)) print(*d.values())
Seems like cookies are disabled on this browser, please enable them to open this website
Word Order
You are viewing a single comment's thread. Return to all comments →
a really elegant solution