Cody

Solution 2065277

Submitted on 20 Dec 2019 by Martin C.
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
x = [ 4 4 5 5 5 6 7 7 8 8 8 8 ]; y_correct = [2 3 1 2 4;4 5 6 7 8]; [q,e]=repvec(x); assert(isequal([q;e],y_correct));

ans = 2 3 1 2 4 4 5 6 7 8

2   Pass
x=[2 2 4 5 5 5 6 6 9 9 9]; y_correct = [2 1 3 2 3;2 4 5 6 9]; [q,e]=repvec(x); assert(isequal([q;e],y_correct));

ans = 2 1 3 2 3 2 4 5 6 9

3   Pass
x=[9 9 9 6 6 6 3 3 8 5 5 5 1 1]; y_correct = [3 3 2 1 3 2;9 6 3 8 5 1]; [q,e]=repvec(x); assert(isequal([q;e],y_correct));

ans = 3 3 2 1 3 2 9 6 3 8 5 1