Cody

Solution 2027752

Submitted on 19 Nov 2019 at 15:50
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 = 1881;y_correct = 30; assert(isequal(yearraey(x),y_correct))

bx = '11101011001' lc = 5 cyb = '11001' nyb = '10111' nybh = '11101' cy = 25 ny = 23 nyh = 29 nypb = '11101110111' nyp = 1911 y = 30

2   Pass
x = 2014;y_correct = 1; assert(isequal(yearraey(x),y_correct))

bx = '11111011110' lc = 5 cyb = '11110' nyb = '11111' nybh = '11111' cy = 30 ny = 31 nyh = 31 y = 1

3   Fail
x = 2015;y_correct = 0; assert(isequal(yearraey(x),y_correct))

bx = '11111011111' lc = 5 cyb = '11111' nyb = '11111' nybh = '11111' cy = 31 ny = 31 nyh = 31 nypb = '11111111111' nyp = 2047 y = 32

Assertion failed.

4   Fail
x = 606;y_correct = 27; assert(isequal(yearraey(x),y_correct))

bx = '1001011110' lc = 5 cyb = '11110' nyb = '01001' nybh = '10010' cy = 30 ny = 9 nyh = 18 nypb = '10100101' nyp = 165 y = -441

Assertion failed.

5   Fail
x = 6006;y_correct = 71; assert(isequal(yearraey(x),y_correct))

bx = '1011101110110' lc = 6 cyb = '110110' nyb = '011101' nybh = '101110' cy = 54 ny = 29 nyh = 46 nypb = '1011111111101' nyp = 6141 y = 135

Assertion failed.

6   Fail
x = 60006;y_correct = 369; assert(isequal(yearraey(x),y_correct))

bx = '1110101001100110' lc = 8 cyb = '01100110' nyb = '01010111' nybh = '11101010' cy = 102 ny = 87 nyh = 234 nypb = '10110000001101' nyp = 11277 y = -48729

Assertion failed.

7   Fail
k=zeros(1,15); for n=1:15 y=2^n+2; k(n)=yearraey(y); end y_correct=[1 1 5 3 11 7 23 15 47 31 95 63 191 127 383]; assert(isequal(k,y_correct))

bx = '100' lc = 1 cyb = '0' nyb = '1' nybh = '1' cy = 0 ny = 1 nyh = 1 y = 1 bx = '110' lc = 1 cyb = '0' nyb = '1' nybh = '1' cy = 0 ny = 1 nyh = 1 y = 1 bx = '1010' lc = 2 cyb = '10' nyb = '01' nybh = '10' cy = 2 ny = 1 nyh = 2 nypb = '1001' nyp = 9 y = -1 bx = '10010' lc = 2 cyb = '10' nyb = '01' nybh = '10' cy = 2 ny = 1 nyh = 2 nypb = '10101' nyp = 21 y = 3 bx = '100010' lc = 3 cyb = '010' nyb = '001' nybh = '100' cy = 2 ny = 1 nyh = 4 nypb = '1001' nyp = 9 y = -25 bx = '1000010' lc = 3 cyb = '010' nyb = '001' nybh = '100' cy = 2 ny = 1 nyh = 4 nypb = '1001001' nyp = 73 y = 7 bx = '10000010' lc = 4 cyb = '0010' nyb = '0001' nybh = '1000' cy = 2 ny = 1 nyh = 8 nypb = '1001' nyp = 9 y = -121 bx = '100000010' lc = 4 cyb = '0010' nyb = '0001' nybh = '1000' cy = 2 ny = 1 nyh = 8 nypb = '100010001' nyp = 273 y = 15 bx = '1000000010' lc = 5 cyb = '00010' nyb = '00001' nybh = '10000' cy = 2 ny = 1 nyh = 16 nypb = '1001' nyp = 9 y = -505 bx = '10000000010' lc = 5 cyb = '00010' nyb = '00001' nybh = '10000' cy = 2 ny = 1 nyh = 16 nypb = '10000100001' nyp = 1057 y = 31 bx = '100000000010' lc = 6 cyb = '000010' nyb = '000001' nybh = '100000' cy = 2 ny = 1 nyh = 32 nypb = '1001' nyp = 9 y = -2041 bx = '1000000000010' lc = 6 cyb = '000010' nyb = '000001' nybh = '100000' cy = 2 ny = 1 nyh = 32 nypb = '1000001000001' nyp = 4161 y = 63 bx = '10000000000010' lc = 7 cyb = '0000010' nyb = '0000001' nybh = '1000000' cy = 2 ny = 1 nyh = 64 nypb = '1001' nyp = 9 y = -8185 bx = '100000000000010' lc = 7 cyb = '0000010' nyb = '0000001' nybh = '1000000' cy = 2 ny = 1 nyh = 64 nypb = '100000010000001' nyp = 16513 y = 127 bx = '1000000000000010' lc = 8 cyb = '00000010' nyb = '00000001' nybh = '10000000' cy = 2 ny = 1 nyh = 128 nypb = '1001' nyp = 9 y = -32761

Assertion failed.