Cody

Solution 1945199

Submitted on 21 Sep 2019 by Augusto Mazzei
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
assert(isequal(simber('1223334444'),true))

y = 1 y = 1 y = 1 y = 1

2   Pass
assert(isequal(simber('122333444'),false))

y = 1 y = 1 y = 1 y = 0

3   Pass
assert(isequal(simber('567886'),true))

y = 1 y = 1 y = 1 y = 1

4   Pass
assert(isequal(simber('999999999888888888'),false))

y = 0 y = 0

5   Pass
assert(isequal(simber('6677788'),true))

y = 1 y = 1 y = 1

6   Pass
v=arrayfun(@(x) simber(num2str(x)),1:100); y_correct=[1 0 1 0 1 0 1 0 1 0 0 0 1 0 1 0 1 0 1 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 1 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 1 0 1 0 0 0 0 0 0 1 0 0 0 0 1 0 1 0 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 1 0 1 0 1 0 1 0 0 1]; assert(isequal(v,y_correct))

y = 1 y = 0 y = 1 y = 0 y = 1 y = 0 y = 1 y = 0 y = 1 y = 0 y = 0 y = 0 y = 1 y = 0 y = 1 y = 1 y = 1 y = 0 y = 1 y = 1 y = 1 y = 0 y = 1 y = 1 y = 1 y = 0 y = 1 y = 1 y = 0 y = 0 y = 1 y = 0 y = 1 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 1 y = 1 y = 0 y = 0 y = 0 y = 1 y = 0 y = 1 y = 1 y = 1 y = 0 y = 1 y = 1 y = 1 y = 0 y = 1 y = 1 y = 0 y = 0 y = 1 y = 0 y = 0 y = 0 y = 1 y = 0 y = 1 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 1 y = 1 y = 0 y = 0 y = 1 y = 1 y = 0 y = 0 y = 0 y = 1 y = 0 y = 1 y = 1 y = 1 y = 0 y = 1 y = 1 y = 0 y = 0 y = 1 y = 0 y = 0 y = 0 y = 1 y = 0 y = 0 y = 0 y = 1 y = 0 y = 1 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 1 y = 1 y = 0 y = 0 y = 1 y = 1 y = 0 y = 0 y = 1 y = 1 y = 0 y = 0 y = 0 y = 1 y = 0 y = 1 y = 1 y = 0 y = 0 y = 1 y = 0 y = 0 y = 0 y = 1 y = 0 y = 0 y = 0 y = 1 y = 0 y = 0 y = 0 y = 1 y = 0 y = 1 y = 0 y = 0 y = 0 y = 0 y = 1 y = 1 y = 0 y = 0 y = 1 y = 1 y = 0 y = 0 y = 1 y = 1 y = 0 y = 0 y = 1 y = 1 y = 0 y = 0 y = 0 y = 1 y = 1

7   Pass
k=arrayfun(@(x) simber(sprintf('%.0f',2^x+1)),1:39); y_correct=[1 1 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]; assert(isequal(k,y_correct))

y = 1 y = 1 y = 1 y = 1 y = 1 y = 0 y = 1 y = 0 y = 1 y = 0 y = 0 y = 0 y = 0 y = 0 y = 1 y = 1 y = 1 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 1 y = 1 y = 0 y = 0 y = 1 y = 1 y = 1 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 1 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 1 y = 1 y = 0 y = 0 y = 0 y = 1 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 1 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 1 y = 1 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 1 y = 1 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 1 y = 1 y = 0 y = 0 y = 0 y = 0 y = 0 y = 1 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 0 y = 1 y = 1 y = 0 y = 0 y = 0 y = 0 y = 0