You are viewing a single comment's thread. Return to all comments →
Condensed down to 2 statements (plus the import):
from collections import Counter d = Counter([input().strip() for _ in range(int(input()))]) print(*[d[input().strip()] for _ in range(int(input()))], sep='\n')
Seems like cookies are disabled on this browser, please enable them to open this website
Sparse Arrays
You are viewing a single comment's thread. Return to all comments →
Condensed down to 2 statements (plus the import):