score:2

Accepted answer

Your solution val Array(_, t) = readLine.split(" ").map(_.toInt) is ok when string contains valid data.

If you know that second token is valid use this:

val t = line.split(" ")(1).toInt

Related Query

More Query from same tag