https://kotlinlang.org logo
#feed
Title
# feed
n

nfrankel

05/26/2019, 6:14 PM
the book is great and applies to any language this week, i tried to use kotlin’s stdlib to write as few characters as possible to solve the problem would appreciate any insight/improvement/comment https://blog.frankel.ch/exercises-programming-style/3/
K 2
p

Pavlo Liapota

05/26/2019, 6:32 PM
You can also write:
Copy code
.groupingBy { it }
        .eachCount()
I believe it will be more readable if you call function
minus
instead of using
-
operator, so you will not need parenthesis around your expression.
n

nfrankel

05/27/2019, 2:37 AM
thanks for your suggestions i didn’t know about
eachCount()
🙂
3 Views