Cody

Solution 369204

Submitted on 12 Dec 2013 by Robert
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
%% xyz = [3,4,2; 0,0,2; 0,1,2; 1,1,2; 1,1,20]; w_correct = 25; assert(isequal(walked(xyz),w_correct))

r = 5 c = 3 w = 0 ss = 0 ss = 9 ss = 25 ss = 25 w = 5 ss = 0 ss = 0 ss = 1 ss = 1 w = 6 ss = 0 ss = 1 ss = 1 ss = 1 w = 7 ss = 0 ss = 0 ss = 0 ss = 324 w = 25 ss = 0

2   Pass
%% xyz = [3,4,2; 0,0,2; 0,1,2; 1,1,2; 1,5,5]; w_correct = 12; assert(isequal(walked(xyz),w_correct))

r = 5 c = 3 w = 0 ss = 0 ss = 9 ss = 25 ss = 25 w = 5 ss = 0 ss = 0 ss = 1 ss = 1 w = 6 ss = 0 ss = 1 ss = 1 ss = 1 w = 7 ss = 0 ss = 0 ss = 16 ss = 25 w = 12 ss = 0

Suggested Problems

More from this Author100