If there is a formal name for this problem (or this is a duplicate and I haven't found the right question to look at) then pointing out what I should actually be searching for would also be appreciated! However, I haven't been able to find any discussion or approaches to this specific problem.
I'm trying to keep the question as simple as possible, if more details would help just let me know.
Say we have four random length vectors of int:
std::vector<int> v1 {1, 7, 5, 2};
std::vector<int> v2 {4, 2, 1};
std::vector<int> v3 {1, 9, 4, 6, 4, 1, 2};
std::vector<int> v4 {9, 4};
Out of these four vectors, I need to generate every possible combination where we select only one int from each source vector (v1 - v4) at a time. The result should be that we generate every possible N length number out of the source vectors where N = the number of source vectors (4 in this case).
A few of the possible combinations are very easy to generate, for example selecting just the first number out of each source vector:
1 4 1 9
Selecting the last number of each source vector:
2 1 2 4
Where I'm stuck is generating every single combination possible. I need every possible N length number that can be created by combining one int from each of the 4 source vectors.
Thank you!