You are viewing a single comment's thread. Return to all comments →
from collections import Counter
n = int(input())
words = [input() for _ in range(n)]
dict_words = Counter(words)
print(len(dict_words))
for s, count in dict_words.items():
print(count, end=' ')
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 →
from collections import Counter
n = int(input())
words = [input() for _ in range(n)]
dict_words = Counter(words)
print(len(dict_words))
for s, count in dict_words.items():