Given a the following table:
Index | Element --------------- 1 | A 2 | B 3 | C 4 | D
We want to generate all th
Am I correctly understanding that you built Cartesian product n x n x n x n, and then filter out unwanted stuff? The alternative would be generating all the numbers up to n! and then using factorial number system to map them via element encoding.