Cody

# Problem 74. Balanced number

Solution 1874204

Submitted on 15 Jul 2019 by yesnope
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))

Lsum = 1 Rsum = 2 Lsum = 4 Rsum = 4

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

Lsum = 2 Rsum = 4 Lsum = 5 Rsum = 5 Lsum = 10 Rsum = 9 Lsum = 16 Rsum = 16

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

Lsum = 2 Rsum = 0 Lsum = 2 Rsum = 1 Lsum = 7 Rsum = 5 Lsum = 13 Rsum = 12

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

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

Lsum = 1 Rsum = 1 Lsum = 2 Rsum = 2 Lsum = 3 Rsum = 3 Lsum = 4 Rsum = 4

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

Lsum = 1 Rsum = 8 Lsum = 3 Rsum = 15 Lsum = 6 Rsum = 21 Lsum = 10 Rsum = 26

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

Lsum = 1 Rsum = 3 Lsum = 3 Rsum = 6

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

Lsum = 9 Rsum = 8 Lsum = 17 Rsum = 17

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

Lsum = 4 Rsum = 0 Lsum = 10 Rsum = 0 Lsum = 19 Rsum = 2

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

Lsum = 5 Rsum = 6 Lsum = 12 Rsum = 12