Problem 2534. Path of least resistance - Move all direction
Solution Stats
Problem Comments
-
7 Comments
I don't understand how this works with negative elements. For example if the input matrix is [0 -1;0 0] it is possible to obtain an arbitrarily low score by going [EastWest] sufficiently many times then EastSouth.
yeah... deleted the negative elements.. was foolish of me to think that way
The eye matrix is tricky - i must admit i cheated.. there is a of torugle with branching, i tried developing algorithm do "look up front" but failded...
I get 11 for test case 2.
May be you are considering the element at the bottom left corner. But, it is not necessary since diagonal movement is also allowed
OK, you're right about test case 2. I was wrong. But I get 6 for test case 1, not 7. The shortest path does not include upper right corner.
yeah, that is wrong.. corrected and thanks. too many mistake in a single problem
Solution Comments
Show commentsProblem Recent Solvers19
Suggested Problems
-
Find the peak 3n+1 sequence value
2087 Solvers
-
1511 Solvers
-
Unique values without using UNIQUE function
288 Solvers
-
Sum the 'edge' values of a matrix
321 Solvers
-
Find out the Gray Code for a Given Binary Number
99 Solvers
More from this Author44
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!