0
Help me write an algorithm to decompose n on k summands
Write all combinations of k summands a1+a2+...+ak=n
6 Respostas
+ 1
What do you mean? is this what you want?
https://code.sololearn.com/cEUAF1jGB52u/?ref=app
+ 1
ShortCode I don't know ruby. what input?
+ 1
Ohh... i think i failed to understand your question. can_be_better i write the program to find the combination of the string input... sorry...
+ 1
can_be_better Where is your try? Futhermore, there is some constrain about summands? If they can be negative integer also, there are infinite combinations
+ 1
true KrOW
0
KrOW ShortCode
https://code.sololearn.com/cyLi65G5aYxv/?ref=app
there it is. but it outputs not all combinations
yes, all values are natural and n is bigger than k