You are viewing a single comment's thread. Return to all comments →
n, m = map(int, input().split()) A = [input() for i in range(1, n+1)] B = [input() for j in range(1, m+1)] for j in B: matches = [] for index, value in enumerate(A): if value == j: matches.append(str(index+1)) if matches: print(" ".join(matches)) 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 →