You are viewing a single comment's thread. Return to all comments →
What about this:
if __name__ == "__main__": n = int(input().strip()) words = [input().strip() for _ in range(n)] counters = {} for word in words: counters[word] = counters.get(word,0)+1 print(len(counters)) print(" ".join(map(str, counters.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 →
What about this: