# Check if two elements exist in a list

I would like to know how i can determine if two elements in a list exist. For example the setup would look like this:

liste = {"b", "d1", "a","z"}
MemberQ[{{"b", "a"}}, liste]


One problem i have is that it should not depend on the order of the two element, i.e. {"b", "a"} == {"a", "b"} that i want to check. I just want to know if these exist in a given list.

• Hello, have a look at the documentation for ContainsAll , cheers! Nov 16 '21 at 19:57
• Intersection can do this: Intersection[liste, {"b", "a"}] != {} Nov 17 '21 at 11:25