• + 1 comment

    Had the same problem and adapted this from @saltybald below:

    val n = io.Source.stdin.getLines.toList.map(.trim).map(.toInt).head

    Not sure what is going on here, but it worked!