What is the output?
fun main() {
val a = listOf(1, 2, 3)
val b = listOf(4, 5, 6)
val pairs = a.zip(b)
println(pairs[1].second)
}
Try it in the online Kotlin Playground →
[spoiler title="Solution"]
Answer:
5
Explanation:
zip pairs elements from two lists at matching indices.
[/spoiler]