Let there be two lists that have sublists:
a[] = {{1, 2}, {1, 2, 3}, {2, 3, 4, 4}, {3, 4, 4, 5}}
and
b[] = { {1, 2}, {4, 5, 6}}
I want to remove all those sublists in a[] that has elements contained in a sublist of b[]. So after removal I am expecting
a[] = {{2, 3, 4, 4}, {3, 4, 4, 5}}.
I am not able to reach specific elements in a sublist. I can use a For loop for this, but it will slow down my program, so I want suggestions on a better Mathematica way of manipulating lists.
Edit
Sorry I guess my example was less than clear about what I am asking for. I want that any sublist in a[]
that has all elements of any sublist from b[]
shall be removed.
a[]
andb[]
? You aren't defining functions or using indexing, so simple identifiers such asa
andb
would be better in your case. $\endgroup$Clear[a]; a[] = 42; a = a[]; {a, a[]}
. This gives{42, 42[]}
as its output. Is that what you would expect or would want? $\endgroup$