1
$\begingroup$

I have a list of lists A={{1,2},{3,6},{7,8},{5,0}}, and another list of lists B={{1,2},{5,0}}. If any list in B is also in A, I want to remove them from A. E.g.,Taking {1,2} and {5,0} out of A to get {{3,6},{7,8}}.

$\endgroup$

marked as duplicate by m_goldberg, Jason B., Szabolcs, Leonid Shifrin, J. M. is away Jul 6 '16 at 14:39

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    $\begingroup$ Have you seen Complement[]? $\endgroup$ – J. M. is away Jul 6 '16 at 13:01
  • 2
    $\begingroup$ Aside from J.M's suggestion, you can also take a look at this: 18100 $\endgroup$ – happy fish Jul 6 '16 at 13:04
  • $\begingroup$ Complement works perfectly! Thanks $\endgroup$ – I A Jul 6 '16 at 13:17
  • 1
    $\begingroup$ Complement treats its inputs and output as sets. This means that the result will be sorted and duplicates will be removed. Is this a problem for your application? $\endgroup$ – Szabolcs Jul 6 '16 at 13:45

Browse other questions tagged or ask your own question.