You need to do a task related to natural language processing: count the occurrence of words in a text. You need to read a line of words and print a map where the key represents a word and the value represents its occurrences. The keys should come in the order they occur in the original line. Below, you can find an example of the output.
Iterators
Frequency word book
Report a typo
Sample Input 1:
little brown fox brown fogSample Output 1:
little 1
brown 2
fox 1
fog 1Write a program in Kotlin
fun main() {
var list = readln().split(" ")
// write your code
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.