You are viewing a single comment's thread. Return to all comments →
from collections import Counter n =int(input()) li=[]
for i in range(n): word=input() li.append(word)
count_words=len(set(li)) print(count_words)
counts = Counter(li)
for count in counts.values(): 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()) li=[]
for i in range(n): word=input() li.append(word)
count_words=len(set(li)) print(count_words)
counts = Counter(li)
for count in counts.values(): print(count,end=" ")