You are viewing a single comment's thread. Return to all comments →
from collections import defaultdict num_words = int(input()) word_frequency: defaultdict[str, int] = defaultdict(int) for _ in range(num_words): word = input().strip() word_frequency[word] += 1 print(len(word_frequency)) for word in word_frequency: print(word_frequency[word], 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 →