Answers for "scala set contains all"

0

scala set contains all

val set = Set(1,2,3,4)
val subset = Set(1,2)

scala> subset.subsetOf(set)
res0: Boolean = true

scala> set.subsetOf(subset)
res1: Boolean = false
Posted by: Guest on April-14-2021

Code answers related to "Scala"

Browse Popular Code Answers by Language