I am trying to write a function which generates all unique combinations of arrays for values up to a certain number.
The function has two parameters, one parameter is the length of the array and the other is the maximum size of the integer.
F(4, 3)
is a function that will generate all possible unique combinations of positive integers less than or equal to 4 in a three integer array. F(10, 100)
will generate all possible unique combinations of positive integers less than or equal to 10 in a 100 integer array.
The result for F(4, 3)
would start like this:
(1, 1, 1), (1, 1, 2), (1, 1, 3), (1, 1, 4), (1, 2, 1), (1, 2, 2) ... (4, 4, 4)
F(10, 10)
would start like this:
(1, 1, 1, 1, 1, 1, 1, 1, 1, 1), (1, 1, 1, 1, 1, 1, 1, 1, 1, 2), ...
(10, 10, 10, 10, 10, 10, 10, 10, 10, 10)