Compare two lists of Scala to check oneOf/Contains

Solution 1:

oneOf can be also written as:

listOfCountries.exists(SecondlistOfCountries.contains)

For contains I suggest the same as @Tim.

Solution 2:

oneOf:

listOfCountries.exists(SecondlistOfCountries.contains)

[ Thanks to @Ava for this version, which is much better than my original solution ]

contains:

SecondlistOfCountries.exists(c => listOfCountries.exists(c.contains))