Here is my problem i need to generate all combination with different order possible for a size of X and the total sum must equal Y. I must give X and Y and i don't know X,Y by advance.
X and Y are integer only.
example :
X=4 #the size of the list must be equal to 4
Y=16 #the sum of the list must be equal to 16
[8,0,1,7] #the size is 4 and the sum of the number equal to 16
[7,1,0,8] #the size is 4 and the sum of the number equal to 16
[2,2,4,8] #the size is 4 and the sum of the number equal to 16
[1,1,6,8] #the size is 4 and the sum of the number equal to 16
Edit :
My first solution would be to make a program write a python file with the combination of X / Y and for loop.
First i will calculate 0 to Y, then brute force it to found the sum of combination for Y. And finally generate all combination.
then execute or import the python file.
But it's not very elegant ...
Regards