You are viewing a single comment's thread. Return to all comments →
from collections import OrderedDict n = int(input()) count = 0 inp_dict = OrderedDict() for i in range(n): word = str(input()) if word in inp_dict: inp_dict[word] += 1 else: inp_dict[word] = 1 count +=1 print(count) print(*(inp_dict[word] for word in inp_dict))
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 →