does anybody have a handy way to convert a linear ...
# announcements
g
does anybody have a handy way to convert a linear array into a "chopped-up" jagged grid given the size of each group? eg
Copy code
val result = listOf("one", "two", "three", "four", "five", "six", "seven", "eight").magicalGroupBy { it -> moreMagic(3, 2, 3) })

assertThat(result).isEqualTo(mapOf(
  "one" to listOf("one", "two", "three"),     //row length == 3
  "four" to listOf("four" "five"),            //len == 2
  "six" to listOf("six", "seven", "eight")    //len == 3
))