You are viewing a single comment's thread. Return to all comments →
n,m = [int(i) for i in input().split()] A = [] B = [] for i in range(n): A.append(input()) for i in range(m): B.append(input())
for i in B: c=0 for j in range(1,len(A)+1): if A[j-1] == i: print(j,end=' ') c=1 if c==0: print(-1) print('')
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 →
test cases 1,2,3,4 not satisfied mates. pls debug this
n,m = [int(i) for i in input().split()] A = [] B = [] for i in range(n): A.append(input()) for i in range(m): B.append(input())
for i in B: c=0 for j in range(1,len(A)+1): if A[j-1] == i: print(j,end=' ') c=1 if c==0: print(-1) print('')