Search
⌘K

Leetcode 2943. Maximize Area of Square Hole in Grid

Given which interior horizontal and vertical bars can be removed from an (n+1)×(m+1) grid, remove some subset to merge adjacent unit cells and form the largest possible square hole, and return its area. The core challenge is to use the sparse lists of removable bars (n,m up to 1e9 but <=100 removable indices) to determine the maximum consecutive removable spans in each dimension that yield the largest square side.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.