I have a collection of car objects and i am looking through them like this:
var slide = CreateSlide();
foreach (var car in carCollection) {
displayonSlide(car, slide)
}
I now realize that i can only fit 5 cars on a slide so i need to take the carCollection and break it up into collections of 5 and then do the loop through each of those 5 (so i create a new slide for each 5 cars that exist in the collection.
What is the best way to break up a single collection into a number of smaller collection based on bucketing by a certain number of items (5 in this case)
obviously the last collection might have the remainder if not divisible.