Consider a function f[l1_List,l2_List]
which is given lists of integers. Whenever two of the lists contain completely disjoint sets of integers OR one of the lists is completely contained in the other, I would like the function to return True
. Whenever both lists overlap, but not completely, I would like the function to return False
. So for example:
f[{1,2},{3,4,5}]
True
f[{1,2,3,4},{2,3}]
True
But
f[{1,2,3},{3,4}]
False
Is there such a function in Mathematica? Or maybe one can implement it conveniently? Thanks for any suggestion!