Question from the Kotlin test

How to flatten a list of lists in Kotlin

Hard
val nombres = listOf(1, 2, 3) // [1, 2, 3]
val result = nombres.flatMap { listOf(it, it, it) }
println(result)

What value of result is displayed in the console?

Author: W3D TeamStatus: PublishedQuestion passed 687 times
Edit
7
Community EvaluationsNo one has reviewed this question yet, be the first!