filtering element of one List from another in Scala with different tuple structure
Apart from my comment, I'd suggest using Set for, well sets, since operations will likely be quicker, but more importantly, they're more correct wrt. what operations can be done on them.
val setB: Set[(String, String)] = ListB.toSet

val filtered: List[((String, String), Int)] =
  ListA.filterNot(x =&gt; setB.contains(x._1))

val result: List[Int] =
  filtered.map(_._2)

This returns a different result.  As I wrote in my comment I don't quite understand the reasoning behind the algorithm and if it's a real requirement that it's going to be iterative like this, you'll likely have to use the implementation you have right now, i.e. via for.
Also splitting the computation into multiple steps might help with understanding what's going on (especially in a debugger), that's also why I copied over the type signatures as you did.

*If the exact same output is desired*, that'd be this then:
val result = ((for {
  m &lt;- ListA.filter(x =&gt; setB.contains(x._1)).map(_._2)
} yield m):::List(0)).slice(0,1)


Nevermind, the same result requires to walk through the list as in the original post.


Also variables shouldn't start with an upper case, c.f. setB instead of SetB.