Product
Pricing
Blog
Forum
NEW
Referral
Description
Solution
Discussion
Submissions
Ask AI
AI Insights
Quick Summary
Given a grid of horizontal and vertical bars, determine the maximum rectangular area formed after removing specified bars.
The maximum hole dimensions are independent, allowing you to calculate the largest vertical and horizontal gaps separately.
Multiply the maximum consecutive gap in rows by the maximum consecutive gap in columns to find the final area.
What This Tests
Independent dimensional analysis
Efficient gap detection without full grid simulation
Array traversal and state tracking
Complexity optimization over brute force
Common Patterns
Hashing
Sorting
Greedy
Collapse
Hint 1
Hint 2
What Interviewers May Ask Next
Report
Report seen similar question in interview
Accepted
3
/7
Acceptance Rate
42.9%
Ask AI Assistant
Ask AI Assistant
Ask me anything about this coding question!
Python3
Auto
Debug
Run
Submit
Test Cases
Input
n =
m =
h =
v =
Output
Expected