At every sunrise a binary orchard wall changes its glowing cells. Given today’s grid, find the largest all-glowing rectangular banner.
Input: rows cols followed by binary row strings. Output maximum rectangle area of 1s.
Example 1:
Input: 4 5
10100
10111
11111
10010
Output: 6
Example 2:
Input: 1 1
1
Output: 1
Example 3:
Input: 2 3
000
000
Output: 0
Constraints:
1≤rows,cols≤2000; rows×cols≤2·10^6.
Tags:
monotonic-stack dynamic-programming matrix
Loading...
Test Cases:No test cases
No test cases available.
The Neon Orchard’s Biggest Banner - HARD Coding Problem | CodeTikki