Cody

Solution 1757652

Submitted on 22 Mar 2019 by Samatha Aleti
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))

s = '13722' s1 = '1' s1 = '13' s2 = '2' s2 = '22'

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

s = '23567414' s1 = '2' s1 = '23' s1 = '235' s1 = '2356' s2 = '7' s2 = '74' s2 = '741' s2 = '7414'

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

s = '20567410' s1 = '2' s1 = '20' s1 = '205' s1 = '2056' s2 = '7' s2 = '74' s2 = '741' s2 = '7410'

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

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

s = '11111111' s1 = '1' s1 = '11' s1 = '111' s1 = '1111' s2 = '1' s2 = '11' s2 = '111' s2 = '1111'

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

s = '12345678' s1 = '1' s1 = '12' s1 = '123' s1 = '1234' s2 = '5' s2 = '56' s2 = '567' s2 = '5678'

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

s = '12333' s1 = '1' s1 = '12' s2 = '3' s2 = '33'

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

s = '9898' s1 = '9' s1 = '98' s2 = '9' s2 = '98'

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

s = '469200' s1 = '4' s1 = '46' s1 = '469' s2 = '2' s2 = '20' s2 = '200'

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

s = '57666' s1 = '5' s1 = '57' s2 = '6' s2 = '66'