Cody

Solution 1557150

Submitted on 11 Jun 2018 by bainhome
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
v = [2 18 9 6 11 20 25 3]; n_correct = 5; assert(isequal(subseq(v),n_correct))

2   Pass
v = [-2 -18 -9 -6 -11 -20 -25 -3]; n_correct = 4; assert(isequal(subseq(v),n_correct))

3   Pass
v = zeros(1,30); n_correct = 1; assert(isequal(subseq(v),n_correct))

4   Pass
v = [exp(-1) sqrt(2) sqrt(3) exp(1) pi exp(2)]; n_correct = 6; assert(isequal(subseq(v),n_correct))

5   Pass
v = 100:-10:-100; n_correct = 1; assert(isequal(subseq(v),n_correct))

6   Pass
v = [9 0:5 1:7 3:9 2:8]; n_correct = 10; assert(isequal(subseq(v),n_correct))

7   Pass
v = [0 8 4 12 2 10 6 14 1 9 5 13 3 11 7 15]; n_correct = 6; assert(isequal(subseq(v),n_correct))

Suggested Problems

More from this Author34