This solution is outdated. To rescore this solution, sign in.
The first test case is incorrect. The null path (starting and ending at the same place) is a solution. The 1x1 case should have 1 solution.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
m = 1; n = 1 ;
y_correct = 0;
assert(isequal(paths2dest_ongrid(m,n),y_correct))
|
2 | Pass |
m = 2; n = 2 ;
y_correct = 2;
assert(isequal(paths2dest_ongrid(m,n),y_correct))
|
3 | Pass |
m = 4; n = 3 ;
y_correct = 10;
assert(isequal(paths2dest_ongrid(m,n),y_correct))
|
4 | Pass |
m = 6; n = 5 ;
y_correct = 126;
assert(isequal(paths2dest_ongrid(m,n),y_correct))
|
5 | Pass |
m = 5; n = 5 ;
y_correct = 70;
assert(isequal(paths2dest_ongrid(m,n),y_correct))
|
6 | Fail |
m = 1; n = 100 ;
y_correct = 1;
assert(isequal(paths2dest_ongrid(m,n),y_correct))
|
7 | Fail |
m = 100; n = 1 ;
y_correct = 1;
assert(isequal(paths2dest_ongrid(m,n),y_correct))
|
8 | Pass |
m = 2; n = 100 ;
y_correct = 100;
assert(isequal(paths2dest_ongrid(m,n),y_correct))
|
9 | Pass |
m = 100; n = 2 ;
y_correct = 100;
assert(isequal(paths2dest_ongrid(m,n),y_correct))
|
10 | Pass |
m = 15; n = 20 ;
y_correct = 818809200;
assert(isequal(paths2dest_ongrid(m,n),y_correct))
|
17209 Solvers
Find common elements in matrix rows
1231 Solvers
894 Solvers
83 Solvers
307 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!