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')
Sparse Arrays
You are viewing a single comment's thread. Return to all comments →
Condensed down to 2 statements (plus the import):