EDIT: Please note, this question is not the same as "Generating all Possible Combinations" Im not looking for a simple Cartesian Product
I need to write a function that produces array of all possible pair combinations of 2 given arrays. So for example:
- a, b, c ...
- x, y ...
I need to find all pair combinations of these numbers, so it will look like:
- Combination 1: a-x, b-y, c
- Combination 2: a-y, b-x, c
- Combination 3: a-x, c-y, b
- Combination 4: a-y, c-x, b
- and so on....
The result should be List of List of Pair, also Pair can contain only 1 number, if initial sets are not equal
thanks
-alex