object RemoveCommonLetters {
def removeCommonLetters(word1: String, word2: String): String = {
word1.filterNot(char => word2.contains(char))
}
def main(args: Array[String]): Unit = {
val word1 = "forest"
val word2 = "tor"
val result = removeCommonLetters(word1, word2)
println(result)
}
}
/*
run:
fes
*/