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
|
1656 Discussions
|
Please Login in order to post a comment
`n=int(input()) l=[input() for i in range(n)] freq={} order=[] for i in l: if i not in freq: freq[i]=1 order.append(i) else: freq[i]+=1 print(len(order)) for i in order: print(freq[i],end=' ')
`