You are viewing a single comment's thread. Return to all comments →
n = int(input()) word_count = {} order = [] for _ in range(n): word = input().strip() if word not in word_count: word_count[word] = 0 order.append(word) word_count[word] += 1 print(len(order)) print(' '.join(str(word_count[word]) for word in order))
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 →