Skip to content

Instantly share code, notes, and snippets.

Kenneth Madsen madken

Block or report user

Report or block madken

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
madken / sortListPair.kt
Created Jul 4, 2017
kotlin sort a list of pairs by second and then first value
View sortListPair.kt
fun sortListPairDesc(list: List<Pair<String, Int>>): List<Pair<String, Int>> {
val result = list.sortedWith(compareBy({ it.second }, { it.first })).asReversed()
return result
You can’t perform that action at this time.