以下是面试问题:
Write a function that outputs the size of the largest square submatrix consisting solely of ones in a square matrix of ones and zeros.
示例 1:
0 1
0 0
输出:1
示例 2:
0 0 0
0 1 1
0 1 1
输出:2
示例 3:
1 1 1
1 1 1
1 1 1
输出 3
我希望尽可能有效地解决这个问题。
最佳答案
使用Search然后 Dynamic Programming .
关于arrays - 在给定的 0's and 1' s 方阵中寻找 1 的最大方子矩阵?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4395063/