val list: MutableList<Rank> = ArrayList<Rank>()
score.forEachIndexed{ index, i -> list.add(Rank(index, i)) }
list.sortWith (Comparator{ a, b ->
when {
a.score == b.score -> a.index - b.index
else -> b.score - a.score
}
})
val reshapeMatrix: Array<IntArray> = Array(r) { i -> IntArray(c) { j -> 0 } }
- 따로 없어서 if, else 나 when으로 처리해야 함
var prev = if (i == 0) 0 else tmp[i - 1]
var next = if (i == flowerbed.size - 1) 0 else tmp[i + 1]
val reorderLogList: MutableList<ReorderLog> = mutableListOf()
reorderLogList.sortWith { a, b ->
if (a == b) a.log.compareTo(b.log)
else a.log.compareTo(b.log)
}
reorderLogList.sortWith(
Comparator { a, b ->
if (a == b) a.log.compareTo(b.log)
else a.log.compareTo(b.log)
}
)