Kotlin: using lambdas

Example:

val list = listOf(1, 2, 3, 4, 5)
Lambdas are a concise way to represent anonymous functions.

Solution:

list.filter { it % 2 == 0 }

Beginner's Guide to Kotlin