I could use the function Intersection
, but it returns a sorted list. That's why I have to do my own, but it looks too big. I hope it could be done shorter.
lists = {{1, 2, 3, 4, 5}, {1, 2, 3, 4}, {2, 3, 4, 5}};
Fold[ Function[ {a, b},
Select[b, MemberQ[a, #] &]
], lists // First, lists // Rest]
{5,7,6,3},{5,6,1,3}
but not{5,7,6,3},{5,6,7,3}
. \$\endgroup\$