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.
Complementdoes – Lukas Lang May 10 '22 at 20:05Out[116]= {{1, 2, 3}, {2, 3, 1}}`
– Daniel Lichtblau May 10 '22 at 20:46Out[4]= {{1, 2, 3}, {2, 3, 1}}`
– Daniel Lichtblau May 10 '22 at 20:48Complementis 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 – user1066 May 11 '22 at 09:25DeleteCases[new, Alternatives@@Join[b,c]]withComplement[new, b,c], wherenew=Reverse@a– user1066 May 11 '22 at 09:44