Cody

# Problem 2651. Find the same and successive values in a vector

Solution 2643439

Submitted on 2 Jul 2020
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   Fail
x = [1,0,0,1,1,1,1,0,1,1,1,0,0,0,1]; y = [ 2 4 9 12 3 7 11 14 0 1 1 0]; assert(isequal(successive_value(x),y))

k = 0 m = 2 4 9 12 l = 0 1 1 0 n = []

Output argument "y" (and maybe others) not assigned during call to "successive_value". Error in Test1 (line 5) assert(isequal(successive_value(x),y))

2   Fail
x = [1,0,0,1,1,1,1,0,2,2,2,0,0,0,2345,2345,2345,2345,2345]; y = [2 4 9 12 15 3 7 11 14 19 0 1 2 0 2345 ]; assert(isequal(successive_value(x),y))

k = 0 m = 2 4 9 12 15 l = 0 1 2 0 2345 n = []

Output argument "y" (and maybe others) not assigned during call to "successive_value". Error in Test2 (line 5) assert(isequal(successive_value(x),y))

3   Fail
x = ones(1,10); y = [1;10;1]; assert(isequal(successive_value(x),y))

k = 0 m = 1 l = 1 n = []

Output argument "y" (and maybe others) not assigned during call to "successive_value". Error in Test3 (line 3) assert(isequal(successive_value(x),y))

4   Fail
x = 1:20; assert(isempty(successive_value(x)))

k = 0 m = [] l = [] n = []

Output argument "y" (and maybe others) not assigned during call to "successive_value". Error in Test4 (line 2) assert(isempty(successive_value(x)))

5   Fail
x = repmat([1,0],[1,1000]); x = [x,fliplr(x)]; y = [2000;2001;0]; assert(isequal(successive_value(x),y))

k = 0 m = 2000 l = 0 n = []

Output argument "y" (and maybe others) not assigned during call to "successive_value". Error in Test5 (line 4) assert(isequal(successive_value(x),y))