I want count the same elements of two lists. Lists can have duplicate elements, so I can\'t convert this to sets and use & operator.
a=[2,2,1,1] b=[1,1,3
Using sets is the most efficient, but you could always do r = [i for i in l1 if i in l2].
r = [i for i in l1 if i in l2]