Cody

Solution 1775853

Submitted on 7 Apr 2019 by danteliujie
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; n=5; y_correct = 5; assert(isequal(hamming2(X,n),y_correct))

mul = 2 3 5 value = 2 3 5

2   Pass
X = 10; n=5; y_correct = 9; assert(isequal(hamming2(X,n),y_correct))

mul = 2 3 5 value = 2 3 5

3   Pass
X = 100; n=5; y_correct = 34; assert(isequal(hamming2(X,n),y_correct))

mul = 2 3 5 value = 2 3 5

4   Pass
X = 100; n=7; y_correct = 46; assert(isequal(hamming2(X,n),y_correct))

mul = 2 3 5 7 value = 2 3 5 7

5   Pass
X = 100; n=100; y_correct = 100; assert(isequal(hamming2(X,n),y_correct))

mul = 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 value = 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97

6   Pass
X = 100; n=13; y_correct = 62; assert(isequal(hamming2(X,n),y_correct))

mul = 2 3 5 7 11 13 value = 2 3 5 7 11 13

7   Pass
X = 10^13; n=7; y_correct = 19674; assert(isequal(hamming2(X,n),y_correct))

mul = 2 3 5 7 value = 2 3 5 7

8   Pass
X = 10^5; n=13; y_correct = 1848; assert(isequal(hamming2(X,n),y_correct))

mul = 2 3 5 7 11 13 value = 2 3 5 7 11 13

9   Pass
X = 10^5; n=5; y_correct = 313; assert(isequal(hamming2(X,n),y_correct))

mul = 2 3 5 value = 2 3 5

10   Pass
X = 123456; n=5; y_correct = 327; assert(isequal(hamming2(X,n),y_correct))

mul = 2 3 5 value = 2 3 5

11   Pass
X = 10^13; n=3; y_correct = 624; assert(isequal(hamming2(X,n),y_correct))

mul = 2 3 value = 2 3

12   Pass
X = 123456; n=2; y_correct = 17; assert(isequal(hamming2(X,n),y_correct))

mul = 2 value = 2