Cody

Solution 1699640

Submitted on 26 Dec 2018 by Nikolaos Nikolaou
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
a = [5 3 6 4 7 7 3 5 9]; b_correct = [5 3 6 4 7 9]; assert(isequal(dedupe(a),b_correct));

dd = 1 8 a = 5 3 6 4 7 7 3 9 dd = 2 7 a = 5 3 6 4 7 7 9 dd = 3 dd = 4 dd = 5 6 a = 5 3 6 4 7 9 b = 5 3 6 4 7 9

2   Pass
a = [1 0 0 0 1 1 1 1 0 0 1 2 2 0 1] b_correct = [1 0 2]; assert(isequal(dedupe(a),b_correct));

a = 1 0 0 0 1 1 1 1 0 0 1 2 2 0 1 dd = 1 5 6 7 8 11 15 a = 1 0 0 0 0 0 2 2 0 dd = 2 3 4 5 6 9 a = 1 0 2 2 dd = 3 4 a = 1 0 2 b = 1 0 2

3   Pass
a = [-1 -1 -1 -1 -1 -1]; b_correct = [-1]; assert(isequal(dedupe(a),b_correct));

dd = 1 2 3 4 5 6 a = -1 b = -1