score:75

Accepted answer

You can use

val unwanted = list2.toSet
list1.filterNot(unwanted)

to remove all items in list2 (you don't need knowledge of duplicates in list2).

score:9

You could try this:

val list1 = List("word1","word2","word2","word3","word1")
val list2 = List("word1","word4")

println(list1.filterNot(list2.contains(_)))

score:15

val list1 = List("word1","word2","word2","word3","word1")
val list2 = List("word1","word4") 
list1 diff list2

This will do it.


Related Query

More Query from same tag