You are viewing a single comment's thread. Return to all comments →
One more version:-
n = int(input()) word_list = [input() for i in range(n)] word_dict = {} for word in word_list: if word_dict.get(word): word_dict[word] += 1 else: word_dict[word] = 1 print(len(word_dict.keys())) vals = list(word_dict.values()) final_vals = list(map(str, vals)) print(" ".join(final_vals))
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 →
One more version:-