cartesianProduct

fun <T, R> Iterable<T>.cartesianProduct(other: Iterable<R>): List<Pair<T, R>>

Returns a list of pairs, where each value corresponds to all possible pairings with values from other. this: A, B, C other: 1, 2 this.cartesianProduct(other) = A to 1, A to 2, B to 1, B to 2, C to 1, C to 2