Cody

# Problem 45458. Minimal Path - 03

Solution 2230947

Submitted on 23 Apr 2020 by atsushi maruyama
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 12 4 6 8 10 100 ; 1 5 7 87 98 2 200;20 56 74 1 34 56 21] y_correct = [1 4 7 10 13 16 17 18 21]; assert(isequal(minimal_path_4(x),y_correct))

x = 1 12 4 6 8 10 100 1 5 7 87 98 2 200 20 56 74 1 34 56 21 y = 1 4 7 10 13 16 17 18 21

2   Pass
x =[1 122 4 6 8 10 100 ; 1 5 7 87 98 2 200;20 56 74 1 34 56 21] y_correct = [1 2 5 8 7 10 13 16 17 18 21]; assert(isequal(minimal_path_4(x),y_correct))

x = 1 122 4 6 8 10 100 1 5 7 87 98 2 200 20 56 74 1 34 56 21 y = 1 2 5 8 7 10 13 16 17 18 21

3   Pass
x = [2 2 2 2 2 0 0 10 1 2 20 0 20 1 2 30 0 0 3 2]; x=flipud(x); y_correct = [1 5 6 7 8 12 16 20]; assert(isequal(minimal_path_4(x),y_correct))

y = 1 5 6 7 8 12 16 20

4   Pass
x=[131 673 234 103 18 201 96 342 965 150 630 803 746 422 111 537 699 497 121 956 805 732 524 37 331]; y_correct = [1 2 7 12 13 18 19 20 25]; assert(isequal(minimal_path_4(x),y_correct))

y = 1 2 7 12 13 18 19 20 25

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!