I'm looking for all the possible combination of number and the permutation of them in a fixed size of array. For example, I have the total number of 5 the desired output will be
5 0 0 0
0 5 0 0
0 0 5 0
0 0 0 5
4 1 0 0
1 4 0 0
1 0 4 0
1 0 0 4
0 1 4 0
and so on... is this possible ?