combination

fun <T> List<T>.combination(n: Int): List<List<T>>

It generates the n-tuple combination of this collection of elements. Rosetta Code: Kotlin Combination

Return

a list of the n list of combinations of this collection

Parameters

n

the number of elements in each combination

Throws

if 0 n the size of the list

Sources

Link copied to clipboard