Given two sets of values:
var subset = new[] { 2, 4, 6, 8 };
var superset = new[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
how do I determine if superset
contains all elements of subset
?
I have come up with this:
superset.Intersect(subset).Count() == subset.Count()
Is this the most logical and efficient method?