What does this print?
fun main() {
val r = (2..10 step 3).toList()
println(r.sum())
}
Try it in the online Kotlin Playground →
[spoiler title="Solution"]
Answer:
15
Explanation:
Range with step creates a progression: [2, 5, 8].
[/spoiler]