Basically I need to do a set substraction operation A-B=C
between two lists.
For example, I have two lists A
and B
:
A = {{1,2,3,4},{3,4,3,4},{1,1,1,5},{1,2,1,2},{4,3,2,1}}
B = {{1,2,1,2}, {1,2,3,4}}
and the result would be all the elements of A
that do not appear in B
and keeping the order of A:
C = {{3,4,3,4},{1,1,1,5},{4,3,2,1}}
It is important to know that list B could be empty in some cases
I am also avoiding loops or recursion. Thank you all <3.
Complement
. It does not retain the order in A. $\endgroup$