Kotlin sortedWith syntax and lambda examples
Briefly

As shown in the example, the key to the solution is knowing how to write a comparator in Kotlin.
Similarly, this is how to sort a list of strings in Kotlin by the string length using sortedWith.
Read at Alvinalexander
[
add
]
[
|
|
]