I have a list of list of strings and a list of strings. for example:
L1=[["cat","dog","apple"],["orange","green","red"]]
L2=["cat","red"]
if L1[i] contains any item from L2 I need to put the pairs (for creating edges in a graph)
like, in my example, I need the pairs ("cat","dog"),("cat,apple"),("red,orange"),("red","green")
What approach should I use to make it most efficient. (My list L1 is huge)