Cody

# Problem 74. Balanced number

Solution 698947

Submitted on 10 Jul 2015 by Amin Ghazanfari
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
%% n = 13722; assert(isequal(isBalanced(n),true))

s1 = 155 s2 = 155 tf = 1

2   Pass
%% n = 23567414; assert(isequal(isBalanced(n),true))

[Warning: Integer operands are required for colon operator when used as index] s1 = 208 [Warning: Integer operands are required for colon operator when used as index] s2 = 208 tf = 1

3   Pass
%% n = 20567410; assert(isequal(isBalanced(n),false))

[Warning: Integer operands are required for colon operator when used as index] s1 = 205 [Warning: Integer operands are required for colon operator when used as index] s2 = 204

4   Pass
%% n = 1; assert(isequal(isBalanced(n),true))

s1 = 49 s2 = 49 tf = 1

5   Pass
%% n = 11111111; assert(isequal(isBalanced(n),true))

[Warning: Integer operands are required for colon operator when used as index] s1 = 196 [Warning: Integer operands are required for colon operator when used as index] s2 = 196 tf = 1

6   Pass
%% n = 12345678; assert(isequal(isBalanced(n),false))

[Warning: Integer operands are required for colon operator when used as index] s1 = 202 [Warning: Integer operands are required for colon operator when used as index] s2 = 218

7   Pass
%% n = 12333; assert(isequal(isBalanced(n),false))

s1 = 150 s2 = 153

8   Pass
%% n = 9898; assert(isequal(isBalanced(n),true))

[Warning: Integer operands are required for colon operator when used as index] s1 = 113 [Warning: Integer operands are required for colon operator when used as index] s2 = 113 tf = 1

9   Pass
%% n = 469200; assert(isequal(isBalanced(n),false))

[Warning: Integer operands are required for colon operator when used as index] s1 = 163 [Warning: Integer operands are required for colon operator when used as index] s2 = 146

10   Pass
%% n = 57666; assert(isequal(isBalanced(n),true))

s1 = 162 s2 = 162 tf = 1