getAllCombinations

fun <T> getAllCombinations(lists: List<List<T>>): List<List<T>>

Cartesian product of lists: every way to pick one element from each inner list, preserving order. The result size is the product of the inner list sizes.