We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Collections
- Word Order
- Discussions
Word Order
Word Order
Sort by
recency
|
1558 Discussions
|
Please Login in order to post a comment
n = int(input()) l= []
for i in range (0,n) : l.append(input())
s = set(l)
print(len(list(s)))
l1 = [] for char in l : if char not in l1 : l1.append(char)
for char in l1 : c = l.count(char) print(c,end=" ")
a = int(input()) result = dict() temp_result = [] for i in range(a): word = input() if word in result: result[word] += 1 else: result[word] = 1
total_keys = 0
for key, values in result.items(): total_keys += 1 temp_result.append(values)
print(total_keys) for res in temp_result: print(res, end= ' ')