We have a list of students. Please group them by the first letter and for each group, returns the name whose length is the greatest.
Grouping collections
List of students
Report a typo
Sample Input 1:
anne dimitry michael alice danySample Output 1:
{a=alice, d=dimitry, m=michael}Write a program in Kotlin
fun main() {
val list = readln().split(" ")
// write your code here
val res =
println(res)
}
___
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.