Skip to content

Instantly share code, notes, and snippets.

@cg4jins
Created July 22, 2019 08:14
Show Gist options
  • Save cg4jins/cf30f906afbbc8d0273f9e350d6d3063 to your computer and use it in GitHub Desktop.
Save cg4jins/cf30f906afbbc8d0273f9e350d6d3063 to your computer and use it in GitHub Desktop.
class Solution {
fun solution(s: String): String {
val chars = s.toCharArray()
val result = chars.sortedWith(Comparator { o1, o2 -> o2 - o1 })
return result.joinToString("")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment