交集

scala> Set(1,2,3) & Set(2,4)
res1: scala.collection.immutable.Set[Int] = Set(2)

并集

scala> Set(1,2,3) | Set(2,4)
res2: scala.collection.immutable.Set[Int] = Set(1, 2, 3, 4)

 

差集

scala> Set(1,2,3) &~ Set(2,4)
res3: scala.collection.immutable.Set[Int] = Set(1, 3)

相关文章:

  • 2022-12-23
  • 2021-09-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-12
  • 2021-06-07
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-07
  • 2022-12-23
  • 2022-12-23
  • 2021-09-27
相关资源
相似解决方案