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
Swap the first and last columns
Remove any row in which a NaN appears
Replace NaNs with the number that appears to its left in the row.
DNA N-Gram Distribution
Rotate a Matrix by 90 degrees
Generate this matrix
Beauty of Parentheses
Elements with highest local average
Integer Sequence - 1
Graph Algorithms - 2 : Chromatic Number
Find the treasures in MATLAB Central and discover how the community can help you!
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office