score:5

Accepted answer

You could try:

int count = ListA.Intersect(ListB).Count();
if ((count == ListA.Count()) || (count == ListB.Count())) {
    // One list contains other
}

score:1

You could use the intersect method and check if the resulting set is the same as either set.

score:4

Check whether a.Except(b) or b.Except(a) is empty.


Related Query

More Query from same tag