So I have two huge lists of strings and I am trying to compare them using Python 3.
List 1 has about 300k values and list 2 has about a million values.
List 1 looks like that:
["aaa","bbb","ccc","ddd"]
List 2 looks like that :
["aaa 1234 asd dsa","hjk lkj 1234","ccc 5678 aaa"]
What is the best way to find if each element from list 1 is a part of each element of list 2? The thing is that there might be more than one element from list 1 that is a part of element in list 2. Also there might be none as well.
If I try a nested loop it takes forever to go through the lists. Is there a better way?