Cody

Solution 1229617

Submitted on 12 Jul 2017 by Gareth Lee
  • Size: 12
  • This is the leading solution.
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
assert(isempty(strfind(fileread('SortMatrix.m'),'sortrows'))) assert(isempty(strfind(fileread('SortMatrix.m'),'unique')))

2   Pass
x = 1; y_correct = 1; assert(isequal(SortMatrix(x),y_correct))

3   Pass
x = [1 3; 2 4;1 5;3 6]; y_correct = [1 3; 1 5;2 4; 3 6]; assert(isequal(SortMatrix(x),y_correct))

4   Pass
x = [4 5 6 3 5 8 3 4 10 2 6 10 2 5 12 1 10 12 2 4 15 1 8 15 2 3 20 1 6 20 1 5 24 2 2 30 1 4 30 1 3 40 1 2 60 1 1 120]; y_correct = [ 1 1 120 ; 1 2 60 ; 1 3 40 ; 1 4 30 ; 1 5 24 ; 1 6 20 ; 1 8 15 ; 1 10 12 ; 2 2 30 ; 2 3 20 ; 2 4 15 ; 2 5 12 ; 2 6 10 ; 3 4 10 ; 3 5 8 ; 4 5 6 ]; assert(isequal(SortMatrix(x),y_correct))