Cody

Solution 1316661

Submitted on 26 Oct 2017 by Daniel Meier
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

This solution is outdated. To rescore this solution, sign in.

Test Suite

Test Status Code Input and Output
1   Pass
assessFunctionAbsence({'regexp','regexpi','regexprep','str2num'},'FileName','fivesteps.m')

2   Pass
% X,Y X<Y between 2 and 100 [x,y]=find(triu(ones(100),1)); z=[x y]; valid=all(z>1,2); assert(fivesteps(z(valid,:))==true);

3   Pass
% X,Y X<Y between 2 and 60 [x,y]=find(triu(ones(60),1)); z=[x y]; valid=all(z>1,2); assert(fivesteps(z(valid,:))==false);

4   Pass
% X,Y X<Y between 2 and 1680 [x,y]=find(triu(ones(1680),1)); z=[x y]; valid=all(z>1,2); assert(fivesteps(z(valid,:))==true);

5   Pass
% X,Y X<Y between 2 and 1700 [x,y]=find(triu(ones(1700),1)); z=[x y]; valid=all(z>1,2); assert(fivesteps(z(valid,:))==false);

6   Pass
% X,Y X<Y between 1 and 20 [x,y]=find(triu(ones(20),1)); z=[x y]; valid=all(z>=1,2); assert(fivesteps(z(valid,:))==false);

7   Pass
% X,Y X<Y between 1 and 30 [x,y]=find(triu(ones(30),1)); z=[x y]; valid=all(z>=1,2); assert(fivesteps(z(valid,:))==true);

8   Pass
% X,Y X<Y between 1 and 40 [x,y]=find(triu(ones(40),1)); z=[x y]; valid=all(z>=1,2); assert(fivesteps(z(valid,:))==false);

9   Pass
% X,Y X<Y between 3 and 5000 [x,y]=find(triu(ones(3000),1)); z=[x y]; valid=all(z>=3,2); assert(fivesteps(z(valid,:))==true);

10   Pass
% X,Y X<Y between 3 and 100 [x,y]=find(triu(ones(100),1)); z=[x y]; valid=all(z>=3,2); assert(fivesteps(z(valid,:))==false);

11   Pass
% X,Y X<Y even between 2 and 40 [x,y]=meshgrid(2:2:40); z=[x(:) y(:)]; valid=y>x; assert(fivesteps(z(valid,:))==false);

12   Pass
% X,Y X<Y odd between 1 and 1000 [x,y]=meshgrid(1:2:1000); z=[x(:) y(:)]; valid=y>x; assert(fivesteps(z(valid,:))==true);

13   Pass
% X,Y X<Y non-primes between 1 and 50 [x,y]=meshgrid(setdiff(1:50,primes(50))); z=[x(:) y(:)]; valid=y>x; assert(fivesteps(z(valid,:))==true);

14   Pass
% X,Y X<Y primes between 1 and 50 [x,y]=meshgrid(primes(50)); z=[x(:) y(:)]; valid=y>x; assert(fivesteps(z(valid,:))==false);

15   Pass
% X,Y X<Y random subset [x,y]=meshgrid([3 5 12 18 20 28 30]); z=[x(:) y(:)]; valid=y>x; assert(fivesteps(z(valid,:))==true);

16   Pass
% X,Y X<Y random subset [x,y]=meshgrid([3 5 12 15 28 30]); z=[x(:) y(:)]; valid=y>x; assert(fivesteps(z(valid,:))==false);

17   Pass
% X,Y X<Y random subset [x,y]=meshgrid([2 4 6 8 12 16 18]); z=[x(:) y(:)]; valid=y>x; assert(fivesteps(z(valid,:))==false);

18   Pass
% X,Y X<Y random subset [x,y]=meshgrid([4 6 8 12 16 18]); z=[x(:) y(:)]; valid=y>x; assert(fivesteps(z(valid,:))==true);

19   Pass
% X,Y X<Y random subset [x,y]=meshgrid([2 3 10 14 15 20 21]); z=[x(:) y(:)]; valid=y>x; assert(fivesteps(z(valid,:))==true);

20   Pass
% X,Y X<Y random subset [x,y]=meshgrid([2 3 5 8 10 14 15 20 21]); z=[x(:) y(:)]; valid=y>x; assert(fivesteps(z(valid,:))==false);