Suppose I have list2 which is a subset of list1. I want to get a res by deleting an element from list1 whenever there is such an element in list2. I think of this as being the reversal of the operations of Join and Complement which respects multiplicities.
Examples
{1, 2, 3, 4} and {1, 3} results in {2, 4}
{1, 2, 3, 3, 4, 4} and {1, 3, 4} results in {2, 3, 4}
My implementation
myComplement[full_, todel_] :=
Fold[Delete[#1, Position[#1, #2, 1, 1]] &, full, todel]
Is there more efficient and elegant way to achieve this?
