Given a sum result x value of a N number of addends, build an array of N elements y such that the following equality is satisfied: sum(y) = x .
For example if: x = 10 and N = 2, possible solutions for y are: [7 3], or [8 2].
More formally if x = a and N = n it results:
y = [y_1 y_2 y_3 ... y_n] where: y_1 + y_2 + y_3 +...+ y_n = a
Important notice: All the elements in y must be different from zero and different from each other . On the other hand I will not take into account if they are integers or decimal numbers .
Hint: You can use several approaches and the solution is not unique. For example you can think to approach with a iterative method or, if you are more accustomed with Algebra, by solving a linear system. This choice it's up to you.
Good luck and enjoy with the solution ;)
funny！
Return a list sorted by number of occurrences
1253 Solvers
587 Solvers
237 Solvers
find the maximum element of the matrix
258 Solvers
Rounding off numbers to n decimals
304 Solvers