Kotlin: using lists and maps

Example:

val numbers = listOf(1, 2, 3, 4, 5) val map = mapOf(1 to "one", 2 to "two", 3 to "three")
Kotlin provides rich standard library functions to work with collections.

Solution:

print(numbers.sum()) // Outputs: 15 print(map[1]) // Outputs: one

Beginner's Guide to Kotlin