I have the List of Lists. For example it looks like:
List<List<Double>> list = new ArrayList<>();
If I iterate it over all elements it looks for example like:
[1, 2, 3]
[4, 5, 6]
[1, 5, 10]
I want to find most efficient method in Java 8 which get me back all possible combinations with exactly one element from every List<Double>
or with another words the permutation of all elements from the different lists. If is it possible without big quantity of for loops. For example:
[1, 4, 1]
[1, 4, 5]
[1, 4, 10]
[1, 5, 1]
....