Cody

Solution 527729

Submitted on 13 Nov 2014 by Jan Orwat
  • Size: 73
  • 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
%% M = [2 3 3 6 7 10 10 11]; r = 3; c = 4; y_correct = [1 4 5 8 9 12]; assert(isequal(pathFinder(M,r,c),y_correct))

2   Pass
%% M = [4 5]; r = 3; c = 3; y_correct = [1 2 3 6 9]; assert(isequal(pathFinder(M,r,c),y_correct))

3   Pass
%% M = [2 5]; r = 3; c = 3; y_correct = [1 4 7 8 9]; assert(isequal(pathFinder(M,r,c),y_correct))

4   Pass
%% M = [2 3 5 10 12 13 13 18 18 19]; r = 5; c = 4; y_correct = [1 6 7 8 9 14 15 20]; assert(isequal(pathFinder(M,r,c),y_correct))

5   Pass
%% M = [ ]; r = 1; c = 1000; y_correct = 1:1000; assert(isequal(pathFinder(M,r,c),y_correct))

6   Pass
%% M = [7 8 9 10 10 11]; r = 6; c = 2; y_correct = [1:6 12]; assert(isequal(pathFinder(M,r,c),y_correct))

7   Pass
%% M = [2 3 4 5 5 10 10 15 15 14 13 14 11 16 16 21 23 24]; r = 5; c = 5; y_correct = [1 6 7 12 17 18 19 20 25]; assert(isequal(pathFinder(M,r,c),y_correct))

Suggested Problems

More from this Author45