You are given three Strings as input. Create a Map using these strings. Use the String as the key, and its length as the value. Return the resulting Map.
Map
Map creation
Report a typo
Sample Input 1:
I love KotlinSample Output 1:
{I to 1}, {love to 4}, {Kotlin to 6}Sample Input 2:
Strings Ints ObjectsSample Output 2:
{Strings to 7}, {Ints to 4}, {Objects to 7}Write a program in Kotlin
fun stringToMap(first: String, second: String, third: String): Map<String, Int> {
// put your code here
}
___
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.