Unscatter the function which calculates the sum of SparseLongArray values.
Memory-efficient data structures in Android
Sum of SparseLongArray values
Report a typo
Reorder lines using drag or arrows. Adjust indentation with left buttons
for (i in 0 until size())
var sum = 0L
fun SparseLongArray.valueSum(): Long {
}
sum += valueAt(i)
return sum
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.