Created
July 22, 2019 08:14
-
-
Save cg4jins/cf30f906afbbc8d0273f9e350d6d3063 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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