[Kotlin] 코틀린 기본 문법 5 (배열 응용)
배열 정렬 listOf() / mutableListOf() val list = listOf(1, 5, 4, 6, 3, 2) val sorted = list.sorted().reversed() println("sorted : $sorted") // sorted : [6, 5, 4, 3, 2, 1] val list2 = mutableListOf(1, 5, 4, 6, 3, 2) list2.sort() list2.reverse() println("sorted : $list2") // sorted : [6, 5, 4, 3, 2, 1] sortedWith val list = listOf("kevin", "steve", "john", "mark", "jadon") val alphabetOrder = list.sort..
2023. 7. 20.