4 ms·
The first question needs a much larger matrix. I started writing the code, but then looked at the letters and saw the solution.
by oleg_kikin 15y ago
The first question needs a much larger matrix. I started writing the code, but then looked at the letters and saw the solution.
- rohananil 15y agothere 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.