Cody

Solution 1846122

Submitted on 11 Jun 2019 by Joanna Lin
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
xy = [3,4; 0,0; 0,1; 1,1]; z_correct = 7; assert(isequal(walked(xy),z_correct))

steps = 4 dim = 2 w = 3 4 v = 0 0 w = 0 0 v = 0 1 w = 0 1 v = 1 1

2   Pass
xy = [3,4; 0,0]; z_correct = 5; assert(isequal(walked(xy),z_correct))

steps = 2 dim = 2 w = 3 4 v = 0 0

3   Pass
xy = [0,0; 5,12; 0,12]; z_correct = 18; assert(isequal(walked(xy),z_correct))

steps = 3 dim = 2 w = 0 0 v = 5 12 w = 5 12 v = 0 12