Cody

Problem 45458. Minimal Path - 03

Solution 2555169

Submitted on 14 Jun 2020
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   Fail
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 ans = 1 2 5 4 7 10 13 16 17 18 21

Assertion failed.

2   Fail
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 ans = 1 2 5 4 7 10 13 16 17 18 21

Assertion failed.

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))

ans = 1 5 6 7 8 12 16 20

4   Fail
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))

ans = 1 2 7 6 11 16 21 22 23 18 19 20 25

Assertion failed.