Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


Is it DP? I think DP is O(N^3)? That will be a funny way(Matlab) to solve this...


Eh, why not just use a flood-fill type algorithm?


Wouldn't the constrained that output area should be for a rectangle cause a problem?




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: