Theo như trong hình này thì e chỉ muốn để lại [a,3][b,3][c,3] thôi, em cảm ơn.
We want to connect the people who have knowledge to the people who need it, to bring together people with different perspectives so they can understand each other better, and to empower everyone to share their knowledge.
Theo như trong hình này thì e chỉ muốn để lại [a,3][b,3][c,3] thôi, em cảm ơn.
val listOfList = listOf( listOf("a", 1), listOf("a", 2), listOf("a", 3), listOf("b", 1), listOf("b", 2), listOf("b", 3), listOf("c", 1), listOf("c", 2), listOf("c", 3) ) val filteredList = listOfList .groupBy { it[0] } .map { group -> listOf( group.key, group.value.maxOf { it[1] as Int } ) } println(filteredList)
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Input your email to receive reset password link, or if you remember your password, you can click