You are viewing a single comment's thread. Return to all comments →
Not bad but your version doesn't run. This one does:
from collections import defaultdict d = defaultdict(list) n, m = list(map(int, raw_input().split())) for i in range(n): d[raw_input()].append(i + 1) for i in range(m): print(' '.join(map(str, d[raw_input()])) or -1)
Seems like cookies are disabled on this browser, please enable them to open this website
DefaultDict Tutorial
You are viewing a single comment's thread. Return to all comments →
Not bad but your version doesn't run. This one does: