Cody

Solution 510418

Submitted on 8 Oct 2014 by Alexandr Ozerov
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
%% A = [1 4 7 10 2 8]; range = 1; inrange = [1 0 1 0 1 1]; assert(isequal(isinrange(A, range),inrange))

n = 6 y = 1 0 1 0 1 1

2   Pass
%% A = [10 15 18 12 3 7 2]; range = 2; inrange = [1 0 0 1 1 0 1]; assert(isequal(isinrange(A, range),inrange))

n = 7 y = 1 0 0 1 1 0 1

3   Pass
%% A = [10 15 18 12 4 7 2]; range = 3; inrange = [1 1 1 1 1 1 1]; assert(isequal(isinrange(A, range),inrange))

n = 7 y = 1 1 1 1 1 1 1

4   Pass
%% A = [10 15 18 12 4 7 2]; range = 1; inrange = [0 0 0 0 0 0 0]; assert(isequal(isinrange(A, range),inrange))

n = 7 y = 0 0 0 0 0 0 0