If I have a variable number of sets (let\'s call the number n), which have at most m elements each, what\'s the most efficient way to calculate the pairwise in
How about using intersection method of set. See below:
A={"a","b","c"} B={"c","d","e"} C={"a","c","e"} intersect_AB = A.intersection(B) intersect_BC = B.intersection(C) intersect_AC = A.intersection(C) print intersect_AB, intersect_BC, intersect_AC