Kotlin, Programming, Software Development, Functional Programming, Coding.
byLength = words.groupBy { it.length } // {5=[apple], 6=[banana, cherry]} Real World Example — data class Student(val id: String, val name: String, val course: String) val students = fetchStudents() // Assume students contains: // Student("101", "Alice", "Math"), Student("101", "Eve", "History"),