I am looking for a intutuve code to generate 1×6 array where each element is random integer (with in specific upper limit) and sums to a given number.
For example a random array where element lower limit [ 0 0 0 0 0 0] and upper limit [ 9 12 25 6 14 7]. The sum of the random integer number adds up to 24, e.g.
[4 3 8 1 3 4 1]
Best Answer