You are viewing a single comment's thread. Return to all comments →
from collections import defaultdict d=defaultdict(list) m,n = input().split() for i in range(1,int(m)+1): a = input() d[a].append(i) for _ in range (int(n)): b = input() if b in d: print(*d[b]) else: print('-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 →