Open jmpark0118 opened 4 years ago
from collections import OrderedDict
if __name__ == '__main__':
d = OrderedDict()
for _ in range(int(input())):
key = input()
if key in d:
d[key] += 1
else:
d[key] = 1
distinct = len(d)
count = [v for k, v in d.items()]
print(distinct)
print(*count)
출처 : https://www.hackerrank.com/challenges/word-order/problem