Problem 42822. balance vector
Given a non-empty vector x with integer elements. x shall be called balance vector if one can split the elements of x into two groups which are in total equal. e.g.
x=[1,1] balance vector because 1=1
x=[1,7] non-balance vector because 1~=7
x=[2,3,5] balance vector because 2+3=5
Write a function that returns true or false depending if the given vector is a balance vector or not!
Solution Stats
Problem Comments
-
1 Comment
Jean-Marie Sainthillier
on 25 Apr 2016
See Problem 74. Balanced number in the same spirit.
Solution Comments
Show commentsProblem Recent Solvers28
Suggested Problems
-
Solve the set of simultaneous linear equations
422 Solvers
-
587 Solvers
-
Reverse the elements of an array
1024 Solvers
-
Matrix rotation as per given angle
114 Solvers
-
122 Solvers
More from this Author9
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!