I have a set:
$$A=\{\{1,2,3\},\{1,3,2\},\{2,1,3\},\{2,3,1\},\{3,1,2\},\{3,2,1\}\}$$
I want to drop elements found in sets B and C from A.
$$B=\{\{1,3,2\},\{2,1,3\}\}$$ $$C=\{\{3,1,2\},\{3,2,1\}\}$$ How can I do this?
My attempts:
A = {{1, 2, 3}, {1, 3, 2}, {2, 1, 3}, {2, 3, 1}, {3, 1, 2}, {3, 2, 1}}
B = {{1, 3, 2}, {2, 1, 3}}
C = {{3, 1, 2}, {3, 2, 1}}
DeleteCases[A, B]
It does not give the desired result I had to write it like this
DeleteCases[A, {1, 3, 2}]
I also tried to do it iteratively but it did not work.
Complement
does $\endgroup$In[113]:= aA = {{1, 2, 3}, {1, 3, 2}, {2, 1, 3}, {2, 3, 1}, {3, 1, 2}, {3, 2, 1}}; bB = {{1, 3, 2}, {2, 1, 3}}; cC = {{3, 1, 2}, {3, 2, 1}}; DeleteCases[aA, Apply[Alternatives, Join[bB, cC]]] Out[116]= {{1, 2, 3}, {2, 3, 1}}
$\endgroup$In[4]:= DeleteElements[aA, Join[bB, cC]] Out[4]= {{1, 2, 3}, {2, 3, 1}}
$\endgroup$Complement
is that the output is sorted. See Complement[] changes order of elements? and How to Delete Elements from List1 appearing in List2? and UnsortedComplement, a resource function that "Delete the elements of some lists from a list x without changing either the order of x or the multiplicities of its elements" by George Beck $\endgroup$