Cody

Solution 925204

Submitted on 19 Jul 2016 by Jonathan Perry
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))

halv_big = 3 halv_sml = 2 p = 137 q = 722 g = 11 h = 11 tf = 1

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

halv_big = 4 halv_sml = 4 p = 2356 q = 7414 g = 16 h = 16 tf = 1

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

halv_big = 4 halv_sml = 4 p = 2056 q = 7410 g = 13 h = 12 tf = 0

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

halv_big = 1 halv_sml = 0 p = 1 q = 1 g = 1 h = 1 tf = 1

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

halv_big = 4 halv_sml = 4 p = 1111 q = 1111 g = 4 h = 4 tf = 1

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

halv_big = 4 halv_sml = 4 p = 1234 q = 5678 g = 10 h = 26 tf = 0

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

halv_big = 3 halv_sml = 2 p = 123 q = 333 g = 6 h = 9 tf = 0

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

halv_big = 2 halv_sml = 2 p = 98 q = 98 g = 17 h = 17 tf = 1

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

halv_big = 3 halv_sml = 3 p = 469 q = 200 g = 19 h = 2 tf = 0

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

halv_big = 3 halv_sml = 2 p = 576 q = 666 g = 18 h = 18 tf = 1

Suggested Problems

More from this Author95