Arrange the lines in the correct sequence so that the code compiles without errors.
Computer scienceProgramming languagesKotlinObject-oriented programmingObject-oriented programming features
Object expressions
Arrange the lines for method
Report a typo
Reorder lines using drag or arrows. Adjust indentation with left buttons
val sortedByLengthDescending = list.sortedWith(object : Comparator<String> {
})
}
fun main() {
}
println(sortedByLengthDescending)
val list = listOf("apple", "banana", "cherry", "date")
override fun compare(s1: String, s2: String): Int {
return s2.length.compareTo(s1.length)
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.