Cody

# Problem 74. Balanced number

Solution 1638081

Submitted on 4 Oct 2018 by Martin C.
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 = 0 s2 = 0 s1 = 49 s2 = 50 s1 = 100 s2 = 100 tf = logical 1

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

s1 = 0 s2 = 0 s1 = 50 s2 = 55 s1 = 101 s2 = 107 s1 = 154 s2 = 156 s1 = 208 s2 = 208 tf = logical 1

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

s1 = 0 s2 = 0 s1 = 50 s2 = 55 s1 = 98 s2 = 107 s1 = 151 s2 = 156 s1 = 205 s2 = 204 tf = logical 0

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

s1 = 0 s2 = 0 tf = logical 1

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

s1 = 0 s2 = 0 s1 = 49 s2 = 49 s1 = 98 s2 = 98 s1 = 147 s2 = 147 s1 = 196 s2 = 196 tf = logical 1

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

s1 = 0 s2 = 0 s1 = 49 s2 = 53 s1 = 99 s2 = 107 s1 = 150 s2 = 162 s1 = 202 s2 = 218 tf = logical 0

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

s1 = 0 s2 = 0 s1 = 49 s2 = 51 s1 = 99 s2 = 102 tf = logical 0

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

s1 = 0 s2 = 0 s1 = 57 s2 = 57 s1 = 113 s2 = 113 tf = logical 1

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

s1 = 0 s2 = 0 s1 = 52 s2 = 50 s1 = 106 s2 = 98 s1 = 163 s2 = 146 tf = logical 0

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

s1 = 0 s2 = 0 s1 = 53 s2 = 54 s1 = 108 s2 = 108 tf = logical 1