Cody

# Problem 1308. Give me Hamming on five, hold the mayo

Solution 1775838

Submitted on 7 Apr 2019
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
tic

2   Fail
x = 5; y_correct = 5; assert(isequal(hamming1(x),y_correct))

i = 5

Assertion failed.

3   Fail
x = 100; y_correct = 34; assert(isequal(hamming1(x),y_correct))

i = 34

Assertion failed.

4   Fail
x = 123456; y_correct = 327; assert(isequal(hamming1(x),y_correct))

i = 327

Assertion failed.

5   Fail
x = 10^13; y_correct = 4301; assert(isequal(hamming1(x),y_correct))

i = 4301

Assertion failed.

6   Fail
x=1:20; y=arrayfun(@(z) hamming1(z),2.^x); y_correct=[2 4 7 12 19 27 38 52 68 87 110 137 167 201 240 284 332 386 446 511]; assert(isequal(y,y_correct)); tval=1000*toc feval( @assignin,'caller','score',floor(min(5000,tval )) );

i = 2 i = 4 i = 7 i = 12 i = 19 i = 27 i = 38 i = 52 i = 68 i = 87 i = 110 i = 137 i = 167 i = 201 i = 240 i = 284 i = 332 i = 386 i = 446 i = 511

Assertion failed.