Given a vector x, return the indices to elements that will sum to exactly half of the sum of all elements.
Example:
Input x = [1 2 3 4 5 6 7] Output xi = [1 6 7]
because
sum(x) = 28 sum(x([1 6 7])) = 14
The answer is not necessarily unique and the order is unimportant. We will just test to make sure that sum(x)/2 is sum(x(xi))
2018 Solvers
1230 Solvers
371 Solvers
How long is the longest prime diagonal?
255 Solvers
Who has power to do everything in this world?
235 Solvers
MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi
Learn moreOpportunities for recent engineering grads.
Apply Today