Suppose I have a list of lists
record = [['g1','g2','g3'],['g2','g4'],['g1','g3','g5'],['g2','g3','g5'],['g1','g4']]
and I have list of tuples
list1 = [('g1','g2'),('g1','g3'),('g1','g4'),('g1','g5'),('g2','g3'),('g2','g4'),('g2','g5'),('g3','g4'),('g3','g5'),('g4','g5')]
now how many times ('g1','g2')
occurs in record ?
solution should be 1 because ('g1','g2')
is present only in ['g1','g2','g3']
I can change list of tuples to list of lists. Is there any easy approach rather than brute force ? because my list of lists may contains 1000k items