Last active
May 1, 2022 14:35
-
-
Save AndroidPoet/eee5b0f8e7f2d4408025e457f9b94c56 to your computer and use it in GitHub Desktop.
eachCount
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val words = "H,e,l,l,o w,o,r,l,d,H,e,l,l,o w,o,r,l,d".split(',') | |
val frequenciesofChars = words.groupingBy { it }.eachCount() | |
println("Counting frequencies letters:") | |
println(frequenciesofChars) | |
//Counting frequencies letters:: | |
//{H=2, e=2, l=6, o w=2, o=2, r=2, d=2} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment