You are viewing a single comment's thread. Return to all comments →
A possible solutions fellers:
from collections import defaultdict df = defaultdict(lambda: -1) b = [] n,m = input().split() for i in range(1, int(n)+1): vl = input() if vl in df: df[vl] += str(i) + ' ' else: df[vl] = str(i) + ' ' for _ in range(int(m)): b.append(input()) for j in b: print(df[j])
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 →
A possible solutions fellers: