面试题答案
一键面试fun main() {
val list = listOf("apple", "banana", "cherry", "date", "fig")
val result = list.groupBy { it.first() }.mapValues { it.value.size }
println(result)
}
fun main() {
val list = listOf("apple", "banana", "cherry", "date", "fig")
val result = list.groupBy { it.first() }.mapValues { it.value.size }
println(result)
}