Divide a seq of pairs into two lists?

Viewed 561

Assume I have a Seq or pairs(or tuples):

val s = Seq((1, "1"), (2, "2"), (3, "3"))

How could I do:

val (ints, strs) = (s.map(_._1), s.map(_._2))

Without iterating the Seq twice?

1 Answers
Related