You are viewing a single comment's thread. Return to all comments →
from collections import OrderedDict N = int(input()) counter_dict = OrderedDict() for i in range(N): string = input() if string not in counter_dict: counter_dict[string] = 1 else: counter_dict[string] += 1 print(len(counter_dict)) print(*counter_dict.values())
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 →