Cody

# Problem 2736. Pernicious Anniversary Problem

Solution 1779418

Submitted on 9 Apr 2019 by Margaret Hoeller
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
x = 5; y_correct = true; assert(isequal(isPernicious(x),y_correct))

b = '101' num = 101 s = 1 num = 1 s = 2 num = 0

2   Pass
x = 1; y_correct = false; assert(isequal(isPernicious(x),y_correct))

b = '1' num = 1 s = 1 num = 0

3   Pass
x = 2^randi(16); y_correct = false; assert(isequal(isPernicious(x),y_correct))

b = '10000000000000' num = 1.0000e+13 s = 1 num = 0

4   Pass
x = 17; y_correct = true; assert(isequal(isPernicious(x),y_correct))

b = '10001' num = 10001 s = 1 num = 1 s = 2 num = 0

5   Pass
x = 18; y_correct = true; assert(isequal(isPernicious(x),y_correct))

b = '10010' num = 10010 s = 1 num = 10 s = 2 num = 0

6   Pass
x = 61; y_correct = true; assert(isequal(isPernicious(x),y_correct))

b = '111101' num = 111101 s = 1 num = 11101 s = 2 num = 1101 s = 3 num = 101 s = 4 num = 1 s = 5 num = 0

7   Pass
x = 6; y_correct = true; assert(isequal(isPernicious(x),y_correct))

b = '110' num = 110 s = 1 num = 10 s = 2 num = 0

8   Pass
x = 2115; y_correct = false; assert(isequal(isPernicious(x),y_correct))

b = '100001000011' num = 1.0000e+11 s = 1 num = 1000011 s = 2 num = 11 s = 3 num = 1 s = 4 num = 0

9   Pass
x = 2114; y_correct = true; assert(isequal(isPernicious(x),y_correct))

b = '100001000010' num = 1.0000e+11 s = 1 num = 1000010 s = 2 num = 10 s = 3 num = 0

10   Pass
x = 2017; y_correct = true; assert(isequal(isPernicious(x),y_correct))

b = '11111100001' num = 1.1111e+10 s = 1 num = 1.1111e+09 s = 2 num = 111100001 s = 3 num = 11100001 s = 4 num = 1100001 s = 5 num = 100001 s = 6 num = 1 s = 7 num = 0