Cody

# Problem 2534. Path of least resistance - Move all direction

Solution 1961444

Submitted on 6 Oct 2019 by Augusto Mazzei
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
x = [1 9 1 1 9 1 9 1 1 3 9 1 9 9 8 1]; y_correct = 6; assert(isequal(lPath(x),y_correct))

val = 1 score = 2 val = 1 score = 3 val = 1 score = 4 val = 1 score = 5 val = 0 score = 5 score = 6

2   Pass
x = [1 9 9 9 9 9 9 1 9 9 9 3 1 9 1 1 1 1 9 9 1]; y_correct = 10; assert(isequal(lPath(x),y_correct))

val = 1 score = 2 val = 3 score = 5 val = 1 score = 6 val = 1 score = 7 val = 1 score = 8 val = 1 score = 9 val = 0 score = 9 score = 10

3   Pass
x = eye(50); y_correct = 2; assert(isequal(lPath(x),y_correct))

val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = 0 score = 1 val = -1 score = 0 score = 2