Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
rohananil
· 15y ago · 0 comments
there is O(m*n) solution for problem 1.
Comments
[–]
oleg_kikin
15y 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.
[–]
rohananil
OP
15y ago
Is it DP? I think DP is O(N^3)? That will be a funny way(Matlab) to solve this...
[–]
Joshim5
15y ago
Eh, why not just use a flood-fill type algorithm?
[–]
rohananil
OP
15y ago
Wouldn't the constrained that output area should be for a rectangle cause a problem?