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 587 times
Edit
1
Community EvaluationsNo one has reviewed this question yet, be the first!
5
Write a function that returns the maximum of two integers in Kotlin2
Concatenate two strings in Kotlin2
Create a data class with a vip property implementing the Human interface3
Write a Kotlin program that evaluates an arithmetic expression.9
How to flatten a list of lists in Kotlin2
Print the value of a nullable string in Kotlin5
Kotlin: Compile the following code and see the error.