6 ms·
there is O(m*n) solution for problem 1.
by rohananil 15y ago
there is O(m*n) solution for problem 1.
- oleg_kikin 15y agoYeah, dynamic programming. It's a well known problem. I'm pretty sure you can just convert the matrix to 1s and 0s, and dump it into Matlab.