Problems > Largest All-Ones Square > Editorial

Largest All-Ones Square — Solution & Editorial

Back to the Problem

dp[i][j] = side of the largest square with bottom-right corner here = 1 + min(top, left, diagonal) when the cell is 1.

Complexity: O(NM)