Largest Square Submatrix
Given a two-dimensional integer matrix
, return the area of the largest square of 1
s.
Constraints
n, m ≤ 200
wheren
andm
are the number of rows and columns inmatrix
https://binarysearch.com/problems/Largest-Square-Submatrix
Examples
Example 1
Input
- matrix =
[[0,0,0,0,0,1,1],
[0,0,0,0,0,1,1],
[1,1,1,1,0,0,0],
[1,1,1,1,0,0,0],
[1,1,1,1,0,0,0],
[1,1,1,1,0,0,0]]
Output
- answer =
16
Explanation
The bottom left square has a bigger area than the top right square.
Leave a comment