in kotlin is there way to get count of word freq s...
# getting-started
a
in kotlin is there way to get count of word freq such as
Copy code
Map<String, Long> collect = 
        wordsList.stream().collect(groupingBy(Function.identity(), counting()));
? I can think of
Copy code
w1.split(" ").groupBy { it }.mapValues { it.component2().size }
but seems wasteful to make list and then just thrwo it away