<Kotlin idiomatic implementation of> I have writte...
# forum
r
Kotlin idiomatic implementation of I have written the following function to find a histogram median. The loop with an external running total looks ugly compared to other more kotlin-esque code. Is there a way to make it more ‘elegant’ without compromising performance? I suspect that there is a function on collections that might do this, but I am not sure which. I would like to be told of it and how to use it… that is the way I learn. /** * Assuming that the receiver is a histogram where the value at each index is the count...