Question from the Kotlin test

Write a Kotlin code that prints 7 to the console.

Medium
val ints = listOf(5, -1, 2, 5, -5, -2)
val sum = ints.filter { it > 0 }.drop(1).sum()
print(sum)

What does the console show?

Author: W3D TeamStatus: PublishedQuestion passed 551 times
Edit
1
Community EvaluationsNo one has reviewed this question yet, be the first!