balance vector - MATLAB Cody - MATLAB Central

Problem 42822. balance vector

Difficulty:Rate

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

46.27% Correct | 53.73% Incorrect
Last Solution submitted on Aug 22, 2024

Problem Comments

Solution Comments

Show comments
R2025a Pre-release highlights
This topic is for discussing highlights to the current R2025a Pre-release.
13
5

Problem Recent Solvers28

Suggested Problems

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!
Go to top of page