in reply to Combinations of an array of arrays...?
The first two tasks could be combined by assigning an array to each bit of a binary number, and iterating over (15..127) and only accepting binary numbers with at least 4 ones in it. But this sort of strategy is not efficient for large numbers of arrays.
To iterate over the elements on each array, you can again use a counting scheme. For the selected arrays @a1,..@ak (k = 4,..,7), form the number N = @a1*...*@ak. Then count from z = 0 to N-1. This number z represents a unique combination of the element positions in your array.
-Mark
|
|---|