You are viewing a single comment's thread. Return to all comments →
How about a sans list1 solution?
list1
from collections import defaultdict d, n = defaultdict(list), list(map(int, input().split())) for i in range(n[0]): d[input()].append(i + 1) for i in range(n[1]): print(' '.join(map(str, d[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 →
How about a sans
list1
solution?