You’re looking for the transpose
method:
scala> val in = List(List(1, 2, 3), List(4, 5, 6), List(7, 8, 9))
in: List[List[Int]] = List(List(1, 2, 3), List(4, 5, 6), List(7, 8, 9))
scala> in.transpose
res0: List[List[Int]] = List(List(1, 4, 7), List(2, 5, 8), List(3, 6, 9))
scala> in.transpose.map(_.sum)
res1: List[Int] = List(12, 15, 18)
solved How to summarize lists in Scala?