I know that in Python, if I have:
list_1 = [1,2,3] list_2 = [2,3,4]
I can do the following to find the intersection between the two:
Use the index-method of lists as sort criterion:
l1 = [3, 2, 1] l2 = [2, 3, 4] sorted(set(l1) & set(l2), key = l1.index)
Out:
[3, 2]