```var acc = 0 val order = IntArray(a.size) { ...
# announcements
j
Copy code
var acc = 0
val order = IntArray(a.size) {
    acc += a[it].size
    acc
}
is there a more succinct accumulator array creation than this?
Copy code
vargs.asIterable().foldIndexed(0 to IntArray(vargs.size)) { vix,(acc, avec), vec ->
            acc.plus(vec.size).let { size -> size to avec.also { avec[vix]=size}   }        }
this seems more fp-ish but I'm going to guess the instruction count is a little higher this way.
n
(0 until a.size).map { a[it].size }.toIntArray()
j
as it happens i noticed im also using the accumulator below that code.
im also not a fan of temp List<Int> .