Kotlin: working with collections
Example:
val numbers = listOf(1, 2, 3, 4, 5)
Kotlin has a rich set of operators to work with collections.
Solution:
val evenNumbers = numbers.filter { it % 2 == 0 }
Example: Solution:Kotlin: working with collections
Kotlin has a rich set of operators to work with collections.
val numbers = listOf(1, 2, 3, 4, 5)
val evenNumbers = numbers.filter { it % 2 == 0 }