LS
Size: a a a
LS
AN
ArrayList(size*count).apply{...}
. Это абсолютно то же самоеAL
listOf(1, 2, 3).repeat(4)
BP
operator fun List<Item>.times(count: Int) = this + this + this + this
PE
BP
listOf(1, 2, 3).repeat(4)
AL
listOf(1, 2) * 4
не совсем понятно, что вернёт ( listOf(1, 2, 1, 2, 1, 2, 1, 2)
или listOf(4, 8)
)BP
LS
Железо + цемент
AN
Железо + цемент
PE
LS
с#
fun List<Item>.times(count: Int) = buildList{repeat(count){addAll(this@times)}
. но я очень не рекомендую делать это оператором.AN
AN
с#
LS
AN
LS
operator fun List<Item>.times(count: Int) = (1..count).flatMap { this }
AN