How to split a collection into buckets
Let’s say we want to watch all of our favorite movies again. But on weekends, we only have time to watch three movies at most. Let’s decide which movies to watch. We need to split our movie catalog into buckets of three films, with one bucket of movies per weekend.
Chunk method divides a collection into buckets, or chunks, of the same size. It receives the chunk size and returns a collection of collections.
Let’s find which movies to watch each weekend.