Sum of SparseLongArray values

Report a typo

Unscatter the function which calculates the sum of SparseLongArray values.

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
              
___

Create a free account to access the full topic