val m = Map(1 -> "a", 2 -> "b", 4 -> "c", 10 -> "d") val s = Set(1,4) m.filterKeys { s.contains(_) == false }
But, if it is a huge card and a huge set, I would suggest to sort them first and mutually repeat through them, choosing the bits you need. Repeated calls to contains may not work as you would like, especially if you use List instead of Set .
source share