viralshah
03/02/2021, 7:06 AMval myList = (1..100).toList().chunked(5) -> gives me the right answer
val result = (1..45).toList().chunked(5)) -> gives me only 9 chunks
Is it possible to add empty lists for the remaining 11 chunks?Youssef Shoaib [MOD]
03/02/2021, 9:20 AMval result = (1..45).toList().let { it.chunked(Math.ceil(it.length / 20f)) }
pdvrieze
03/02/2021, 12:23 PMtakeN
function to pick the amount you actually want.