Cody

Solution 1555329

Submitted on 9 Jun 2018 by William
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
q = [0 0]; db = [0 0 0 0]; hamming_distances = [0 0]; assert(isequal(hammings(q, db), hamming_distances ));

2   Pass
q = 128; db = 4; hamming_distances = 2; assert(isequal(hammings(q, db), hamming_distances ));

3   Pass
q = [ 0 0 0 128 128 0]; db = [128 255 0 0 0 0]; hamming_distances = [2 9 1; 2 9 1; 1 8 0]; assert(isequal(hammings(q, db), hamming_distances ));

4   Pass
q = [128 128]; db = [255 0 255 0]; hamming_distances = [14 2]; assert(isequal(hammings(q, db), hamming_distances));

5   Pass
q = [ 0 0 0 128 128 0]; db = [128 255 0 0]; hamming_distances = [2 9; 2 9; 1 8]; assert(isequal(hammings(q, db), hamming_distances ));