This problem is inspired by https://www.mathworks.com/matlabcentral/cody/problems/1483-number-of-paths-on-a-grid and https://www.mathworks.com/matlabcentral/cody/problems/44066-number-of-paths-on-a-3d-grid, which you might want to solve first.
Consider n-dimensional grid, and you are moving from one corner to the farthest corner in a minimal number of moves. Each move corresponds to moving to a neighbouring hypercube (among possible up to 2*n neighbours). How many ways are there?
Input format is a row array of size "d" (for d dimension) with number of grid points on each direction.
Optional: can you solve it without loops?
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers51
Suggested Problems
-
Number of 1s in a binary string
11561 Solvers
-
Return elements unique to either input
817 Solvers
-
middleAsColumn: Return all but first and last element as a column vector
653 Solvers
-
Find out sum and carry of Binary adder
1822 Solvers
-
517 Solvers
More from this Author9
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!