Problem 2176. Which way to go?
61.26% Correct | 38.74% Incorrect
Last Solution submitted on Jan 29, 2023
James on 12 Feb 2014
I think your answers in the test suite are for an (m+1)x(n+1) grid, as there are only two ways to reach the bottom right for a 2x2 grid. Check out http://www.mathworks.com/matlabcentral/cody/problems/1483-number-of-paths-on-a-grid for more details.
Zikobrelli on 13 Feb 2014
There are 6 ways of reaching the bottom right corner of a 2*2 grid. Are you considering m*n lines or m*n boxes?
James on 28 Feb 2014
I was considering m*n vertices, not boxes. If you have a 2x2 grid of boxes (3x3 vertices), then you're correct; there are six ways to reach the bottom. Just some miscommunication there.
Problem Recent Solvers67
Duplicate each element of a vector.
More from this Author12
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!