You are viewing a single comment's thread. Return to all comments →
n, m = input().split() group_A = [] group_B = [] for i in range(int(n)): group_A.append(input()) for i in range(int(m)): group_B.append(input()) for elementB in group_B: indices= [str(i+1) for i, elementA in enumerate(group_A) if elementA == elementB] if indices: print(" ".join(indices)) 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 →
Without defalutdict