DSA icon indicating copy to clipboard operation
DSA copied to clipboard

Maximum square area in a binary matrix. DP.

Open akshaygidwani404 opened this issue 3 years ago • 1 comments

Given a binary matrix, find out the maximum size square sub-matrix with all 1s. For example, consider the below 6x5 binary matrix:

{0, 1, 1, 0, 1} {1, 1, 0, 1, 0} {0, 1, 1, 1, 0} {1, 1, 1, 1, 0} {1, 1, 1, 1, 1} {0, 0, 0, 0, 0}

Output: 9 Explaination: Largest square matrix possible is 1 1 1 1 1 1 1 1 1 here side is 3 units hence area = 9.

akshaygidwani404 avatar Oct 07 '21 21:10 akshaygidwani404