Returns list of lists containing count elements each, where each new chunk starts step elements into the enumerable.
- array: Location of the list to chunk
- count: The number of elements for the new chunk (list)
- step: The steps into the enumerable each new chunk starts
- leftover: The value to fill the last chunk if not completely filled
- output-location: Location to store the output data
Let’s say we have a list with six elements.
Target: Location of the original list
[1, 2, 3, 4, 5, 6]
Group the chunk in elements of three.
The start of each chunk to start two steps into the enumerable
If the last chunk is not completely filled, include this value to the end.
[[1, 2, 3], [3, 4, 5], [5, 6, 7]]