Y
Hacker News
new
|
ask
|
show
|
jobs
by
rajatsuri
5427 days ago
nice work!
1 comments
oleg_kikin
5427 days ago
The first question needs a much larger matrix. I started writing the code, but then looked at the letters and saw the solution.
link
rohananil
5427 days ago
there is O(m*n) solution for problem 1.
link
oleg_kikin
5427 days ago
Yeah, 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.
link
rohananil
5427 days ago
Is it DP? I think DP is O(N^3)? That will be a funny way(Matlab) to solve this...
link
Joshim5
5427 days ago
Eh, why not just use a flood-fill type algorithm?
link
rohananil
5426 days ago
Wouldn't the constrained that output area should be for a rectangle cause a problem?
link