Monday 16 May 2022

Scala Function - Diff

 Diff computes the difference  between LHS and RHS collection


 def diffExample(): Unit = {
    val input1 = List(5,4,3,2,1)
    val input2 = List(1,2,3)
    println(s"input1 diff input2 ${input1 diff input2}")//5,4
    println(s"input2 diff input1 ${input2 diff input1}") //Empty
  }

No comments:

Post a Comment