Problem 74. Balanced number
Solution Stats
Problem Comments
-
1 Comment
GEORGIOS BEKAS
on 25 Jan 2018
there is a problem with the test.
it does not accept the following code:
s1=[]
s2=[]
l=length(s)
if mod(l,2)~= 0
for i = 1:ceil(length(s)/2)-1
s1 = [s1,str2double(s(i))]
end
for i = ceil(length(s)/2)+1:l
s2=[s2,str2double(s(i))]
end
else
for i = 1:ceil(length(s)/2)
s1 = [s1,str2double(s(i))]
end
for i = ceil(length(s)/2)+1:l
s2=[s2,str2double(s(i))]
end
end
if sum(s1)==sum(s2)
tf = 1
else
tf = 0
end
Solution Comments
Show commentsProblem Recent Solvers2679
Suggested Problems
-
Return the 3n+1 sequence for n
7570 Solvers
-
Sort a list of complex numbers based on far they are from the origin.
5260 Solvers
-
1522 Solvers
-
1489 Solvers
-
712 Solvers
More from this Author96
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!