You have a list with website URLs with some mistakes — capital letters. Print the number of the list elements, fix the mistakes in each element of this list, make a map with the domains as key and the length of the respective URLs as value. Try to do it within the body of a proper scope function.
Note: Don't print the whole map, only return it.
Scope functions: let, run, and with
Filter and match lists
Report a typo
Sample Input 1:
htTpS://hypeRskIll.org HTTPS://www.jetbrains.com https://github.comSample Output 1:
3
{https://hyperskill.org=22, https://www.jetbrains.com=25, https://github.com=18}Write a program in Kotlin
fun filterAndMatch() : Map<String, Int>{
//write 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.