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 615 times
Edit
2
Community EvaluationsNo one has reviewed this question yet, be the first!
3
Write a Kotlin program that evaluates an arithmetic expression.6
Write a function that returns the maximum of two integers in Kotlin2
Print the value of a nullable string in Kotlin2
In Kotlin, adding an element to a list does not change the list.4
Create a data class with a vip property implementing the Human interface10
How to flatten a list of lists in Kotlin5
Kotlin: Compile the following code and see the error.