Join Slack
Powered by
how can I easily get a (sorted) frequency map of a...
# announcements
a
Alowaniak
11/09/2018, 7:36 PM
how can I easily get a (sorted) frequency map of a LongArray? is there something neater than
longArray.toList().groupingBy{ it }.eachCountTo(sortedMapOf())
?
i
ilya.gorbunov
11/10/2018, 8:39 PM
You can use
asList
instead of
toList
, but otherwise it's pretty neat.
5
Views
Open in Slack
Previous
Next