oday
01/14/2020, 12:09 PMindices
val n = arr.size
for (i in 0 until n - 1) {
for (j in 0 until n - i - 1) {
Mike
01/14/2020, 12:27 PMval arr = arrayOf(1,2,3)
arr.forEachIndexed {index, value ->
println("v:$value")
arr.take(arr.size - index).forEach {
println("int:$it")
}
}
oday
01/14/2020, 12:47 PMMike
01/14/2020, 1:37 PMtake
will create an intermediate list, so if you have a LARGE list, that could create a performance issue.