We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
# Enter your code here. Read input from STDIN. Print output to STDOUTfromcollectionsimportdefaultdictn,m=map(int,input().split())groups=defaultdict(list)for_inrange(n):groups["A"].append(input())for_inrange(m):groups["B"].append(input())forcharingroups["B"]:if(charnotingroups["A"]):print(-1,end=" ")forxinrange(len(groups["A"])):if(char==groups["A"][x]):print((x+1),end=" ")print('')
Cookie support is required to access HackerRank
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 →