I'm trying to read a single line from the console, convert entered numbers to Integers, and add them to
Array<Int>
The shortest one-liner I came up with is
val na: Array<Int> = readLine()!!.split(' ').map{it.toInt()}.toTypedArray() // Array<Int>
This is much longer than e.g python version below. Is it possible to write a shorter code to achieve the same result? This would matter in the compativive programming.
na = [int(i) for i in input().split(' ')]