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}}.

  • 2
    $\begingroup$ Have you seen Complement[]? $\endgroup$ Jul 6 '16 at 13:01
  • 2
    $\begingroup$ Aside from J.M's suggestion, you can also take a look at this: 18100 $\endgroup$
    – vapor
    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.