I have three arrays:
{} {a, b, c} {d, e}
I am trying to combine them to get the following arrays:
{a, d} {a, e} {b, d} {b, e} {c, d} {c, e}
The problem I am facing is the first empty array, because of which the cycle of nested loops does not start at all - logically makes sense. i.e:
for (int i = 0; i < bL.size(); i++) { for (int j = 0; j < dL.size(); j++) { for (int k = 0; k < oL.size(); k++) {
What I'm trying to find is the most efficient way to combine three arrays regardless of their size. In most cases, all three have elements, but there are times when you can create an empty set.
Any help was appreciated.
EDIT: adding output for all three arrays
Entrance - {A, b} {CD} {E, e}
The output is {A, c, e} {A, c, e} {A, d, e} {A, d, e} {b, c, e} {b, s, e}
EDIT: only for the first or third array is an empty set possible