setPartition

fun <T> setPartition(originalSet: Collection<T>, size: Int): List<Set<T>>

Divide a Collection in a List of sets with a maximum size.

Return

A List with the partitions of the given collection.

Parameters

originalSet

The collection to divide.

size

The maximum size of the partitions.