I'm sorry if this is a duplicate, but I haven't found a solution to my problem. I have 4 groups of words, I need to create all possible combinations of 4, yet keeping group restrictions (ie. there must be a word from each group and no doubling from a group).
Psuedo-code example:
Group1 = [A1, A2]
Group2 = [B1, B2]
Group3 = [C1, C2]
Group4 = [D1, D2]
Result:
A1 B1 C1 D1,
A2 B1 C1 D1,
A1 B2 C1 D1 ...
Unacceptable:
A1 A2 B1 C1,
A1 B1 B2 C1
I really don't even know where to start something like this. Initial groups are arrays.
Thanks in advance.