This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""Find height, width of the largest rectangle containing all 0's in the matrix. | |
The algorithm for `max_size()` is suggested by @j_random_hacker [1]. | |
The algorithm for `max_rectangle_size()` is from [2]. | |
The Python implementation [3] is under CC BY-SA 3.0 | |
(if you need other license, e-mail me) | |
[1]: http://stackoverflow.com/questions/2478447/find-largest-rectangle-containing-only-zeros-in-an-nn-binary-matrix#comment5169734_4671342 |