Is there a way to avoid this for loop in favor of efficiency? I was thinking about iter/next functions but they don't seem to work properly..
def foo():
lst = [['a', 'b', 'c', 'd'], ['d', 'e', 'f', 'g'], ['d', 'h', 'i', 'j']]
res = set(lst[0])
for word in lst:
res = res.intersection(word)
return ''.join(res)