I want to delete one of each (and not all) selected element in a list containing duplicates.
For example i have the list: $\{1,1,1,2,2,3\}$ and i want to delete $\{1,3\}$ so the leftover should be $\{1,1,2,2\}$ (and not $\{2,2\}$).
I tried working with $DeleteCases$ and $Alternatives$, but could only delete all elements which match the pattern:
r={1,1,1,2,2,3};
del={1,3};
DeleteCases[r, Alternatives @@ del]
Little side question: Is there a better way for adding elements than
add={4,5};
Flatten[Append[r, add]]
?
Thanks a lot, kon
Flatten[{r,add}]
, orAppendTo[r,add]
orJoin[r,add]
I think should all work... $\endgroup$