Cody

Solution 2055369

Submitted on 12 Dec 2019 by ren yi xin ren
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));

m = 1 n = 9 A = [] A = 8 A = 8 7 A = 8 7 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 m = 1 n = 15 A = [] A = 5 A = 5 6 A = 5 6 7 A = 5 6 7 8 A = 5 6 7 8 11 A = 5 6 7 8 11 15 A = 5 6 7 8 11 15 3 A = 5 6 7 8 11 15 3 4 A = 5 6 7 8 11 15 3 4 9 A = 5 6 7 8 11 15 3 4 9 10 A = 5 6 7 8 11 15 3 4 9 10 14 A = 5 6 7 8 11 15 3 4 9 10 14 4 A = 5 6 7 8 11 15 3 4 9 10 14 4 9 A = 5 6 7 8 11 15 3 4 9 10 14 4 9 10 A = 5 6 7 8 11 15 3 4 9 10 14 4 9 10 14 A = 5 6 7 8 11 15 3 4 9 10 14 4 9 10 14 9 A = 5 6 7 8 11 15 3 4 9 10 14 4 9 10 14 9 10 A = 5 6 7 8 11 15 3 4 9 10 14 4 9 10 14 9 10 14 A = 5 6 7 8 11 15 3 4 9 10 14 4 9 10 14 9 10 14 6 A = 5 6 7 8 11 15 3 4 9 10 14 4 9 10 14 9 10 14 6 7 A = 5 6 7 8 11 15 3 4 9 10 14 4 9 10 14 9 10 14 6 7 8 A = 5 6 7 8 11 15 3 4 9 10 14 4 9 10 14 9 10 14 6 7 8 11 A = 5 6 7 8 11 15 3 4 9 10 14 4 9 10 14 9 10 14 6 7 8 11 15 A = 5 6 7 8 11 15 3 4 9 10 14 4 9 10 14 9 10 14 6 7 8 11 15 7 A = 5 6 7 8 11 15 3 4 9 10 14 4 9 10 14 9 10 14 6 7 8 11 15 7 8 A = 5 6 7 8 11 15 3 4 9 10 14 4 9 10 14 9 10 14 6 7 8 11 15 7 8 11 A = 5 6 7 8 11 15 3 4 9 10 14 4 9 10 14 9 10 14 6 7 8 11 15 7 8 11 15 A = 5 6 7 8 11 15 3 4 9 10 14 4 9 10 14 9 10 14 6 7 8 11 15 7 8 11 15 8 A = 5 6 7 8 11 15 3 4 9 10 14 4 9 10 14 9 10 14 6 7 8 11 15 7 8 11 15 8 11 A = 5 6 7 8 11 15 3 4 9 10 14 4 9 10 14 9 10 14 6 7 8 11 15 7 8 11 15 8 11 15 A = Columns 1 through 30 5 6 7 8 11 15 3 4 9 10 14 4 9 10 14 9 10 14 6 7 8 11 15 7 8 11 15 8 11 15 Column 31 11 A = Columns 1 through 30 5 6 7 8 11 15 3 4 9 10 14 4 9 10 14 9 10 14 6 7 8 11 15 7 8 11 15 8 11 15 Columns 31 through 32 11 15 A = Columns 1 through 30 5 6 7 8 11 15 3 4 9 10 14 4 9 10 14 9 10 14 6 7 8 11 15 7 8 11 15 8 11 15 Columns 31 through 33 11 15 10 A = Columns 1 through 30 5 6 7 8 11 15 3 4 9 10 14 4 9 10 14 9 10 14 6 7 8 11 15 7 8 11 15 8 11 15 Columns 31 through 34 11 15 10 14 A = Columns 1 through 30 5 6 7 8 11 15 3 4 9 10 14 4 9 10 14 9 10 14 6 7 8 11 15 7 8 11 15 8 11 15 Columns 31 through 35 11 15 10 14 14 A = Columns 1 through 30 5 6 7 8 11 15 3 4 9 10 14 4 9 10 14 9 10 14 6 7 8 11 15 7 8 11 15 8 11 15 Columns 31 through 36 11 15 10 14 14 15 A = Columns 1 through 30 5 6 7 8 11 15 3 4 9 10 14 4 9 10 14 9 10 14 6 7 8 11 15 7 8 11 15 8 11 15 Columns 31 through 37 11 15 10 14 14 15 13 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));

m = 1 n = 6 A = [] A = 2 A = 2 3 A = 2 3 4 A = 2 3 4 5 A = 2 3 4 5 6 A = 2 3 4 5 6 3 A = 2 3 4 5 6 3 4 A = 2 3 4 5 6 3 4 5 A = 2 3 4 5 6 3 4 5 6 A = 2 3 4 5 6 3 4 5 6 4 A = 2 3 4 5 6 3 4 5 6 4 5 A = 2 3 4 5 6 3 4 5 6 4 5 6 A = 2 3 4 5 6 3 4 5 6 4 5 6 5 A = 2 3 4 5 6 3 4 5 6 4 5 6 5 6 A = 2 3 4 5 6 3 4 5 6 4 5 6 5 6 6 a = -1 b = -1

Suggested Problems

More from this Author95