Cody

Solution 490227

Submitted on 25 Aug 2014
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
%% vec = [2 2 1 2 3 4 1 2]; out = [2 2 1 2 1 2]; assert(isequal(removeSingle(vec),out))

2   Pass
%% vec = ones(1,10000); out = vec; assert(isequal(removeSingle(vec),out))

3   Pass
%% vec = []; out = []; assert(isequal(removeSingle(vec),out))

4   Fail
%% vec = [1 2 3 4 5]; out = []; assert(isequal(removeSingle(vec),out))

Error: Assertion failed.

5   Pass
%% vec = [4 4 5 5 1 1 2 2]; out = vec; assert(isequal(removeSingle(vec),out))

6   Pass
%% vec = [4 1 4]; out = [4 4]; assert(isequal(removeSingle(vec),out))

7   Pass
%% s = evalc('type removeSingle'); if (~isempty(regexp(s,'for'))) | (~isempty(regexp(s,'while'))) | (~isempty(regexp(s,'assert'))) | (~isempty(regexp(s,'error'))) while(1) end end

Suggested Problems

More from this Author45