I know this seems silly but I need to create a function generate_sum_array(seed,factor)
that will create an array of any number of elements arranged in random order in which all the array elements sum up to seed
and have each have element is divisible by factor
For example:
generate_sum_array(100.10)
should return something like
[20,10,40,10,20]
or [10,10,10,10,10,10,10,10,10,10]
or [50,20,10,30,]
etc. as long as the sum of all the elements is 100
the seed
There can be unlimited possibilities (I think.....I am not really sure....How many different arrays can be generated)