Cody

Problem 45458. Minimal Path - 03

Solution 2230913

Submitted on 23 Apr 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

Unrecognized function or variable 'h'. Error in minimal_path_4 (line 2) a = [h*ones(1,w-1) ones(1,h-1)]; Error in Test1 (line 3) assert(isequal(minimal_path_4(x),y_correct))

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

Unrecognized function or variable 'h'. Error in minimal_path_4 (line 2) a = [h*ones(1,w-1) ones(1,h-1)]; Error in Test2 (line 3) assert(isequal(minimal_path_4(x),y_correct))

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

Unrecognized function or variable 'h'. Error in minimal_path_4 (line 2) a = [h*ones(1,w-1) ones(1,h-1)]; Error in Test3 (line 7) assert(isequal(minimal_path_4(x),y_correct))

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

Unrecognized function or variable 'h'. Error in minimal_path_4 (line 2) a = [h*ones(1,w-1) ones(1,h-1)]; Error in Test4 (line 8) assert(isequal(minimal_path_4(x),y_correct))