You are viewing a single comment's thread. Return to all comments →
Counter makes it even easier
from collections import Counter, defaultdict counter = defaultdict(int, Counter([raw_input() for _ in range(input())])) for _ in range(input()): print counter[raw_input()]
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 →
Counter makes it even easier