dpaukov / combinatoricslib3

Combinatorial objects stream generators for Java.
Apache License 2.0
177 stars 24 forks source link

Combinations of lists? #4

Closed KevinTyrrell closed 6 years ago

KevinTyrrell commented 7 years ago

I have n lists all of the same type. I want to loop through all the possible combinations of pulling one item from each of those lists.

Ex.

List 1 = { Red, Blue, Orange } List 2 = { Brown } List 3 = { White, Black }

Red Brown White Red Brown Black Blue Brown White Blue Brown Black Orange Brown White Orange Brown Black

How can I do that with this library? Thanks

dpaukov commented 6 years ago

This enhancement (cartesian product generator) will be released by the end of May 2018 in version 3.2.1

dpaukov commented 6 years ago

https://github.com/dpaukov/combinatoricslib3#7-cartesian-product

KevinTyrrell commented 6 years ago

Great addition. Thanks.