Find the maximum side length of two equal, non-overlapping all-true squares in a boolean grid.
Unlock detailed company stats for this questionUpgrade
Given an N x M boolean grid representing a map, where A[R][C] = true means a solar power plant can be built on that cell and false means it cannot. Place two square-shaped power plants such that both squares are the same size, every cell inside each square is true, and the two squares do not share any cell. A single cell (1x1) counts as a valid square. Find the maximum possible side length of the two equal squares.
Constraints: N, M <= 700.
Closest LeetCode problem: 221 (Maximal Square), which only covers the base DP.
Format · Online assessment.
Community answers
No answers contributed by the community yet.


