Answer the question
In order to leave comments, you need to log in
Algorithm for enumeration of combinations by blocks?
Good evening.
There is such an array with data (there can be a lot of blocks inside)
[
[
{'name': 'id1', 'value': 1991},
{'name': 'id2', 'value': 1992},
{'name': 'id3', 'value': 1993},
{'name': 'id4', 'value': 1994}
],
[
{'name': 'id5', 'value': 1995},
{'name': 'id6', 'value': 1996}
],
[
{'name': 'id7', 'value': 1997},
{'name': 'id8', 'value': 1998},
{'name': 'id9', 'value': 1999},
{'name': 'id10', 'value': 19910},
{'name': 'id11', 'value': 19911},
{'name': 'id12', 'value': 19912}
]
}
for f in first:
for s in second:
for t in third:
print f, '.', s, '.', t
Answer the question
In order to leave comments, you need to log in
You, please define the problem. That is, the input data is understandable. What is the output? combinatorial union? All permutations?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question