I am trying to compare two arrays.

QUESTION: Do all elements in Array 1 contain at least one element from the second array?

Array 1 {“Robert Jones”, “Harry Smith”,“John Johnson”}

Array 2 {“Jones”,“Smith”}

Array 3 {“Jones”,“Smith”,“Johnson”,“Edwards”}

I want to compare Array 1 and Array 2 to see if all of the elements in Array 1 contain at least one element from Array 2.

Answer:

When comparing Arrays 1 and 2, the answer should be FALSE since the 3rd element of Array 1 does not contain any element from Array 2.

When comparing Array 1 and 3, the answer would be TRUE