Problem Statement:


Maximum size square sub-matrix with all 1s Given a binary matrix, find out the maximum size square sub-matrix with all 1s.

For example, consider the below 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


The maximum square sub-matrix with all set bits is

    1  1  1
    1  1  1
    1  1  1


Solution:



This is a Premium content.
Please subscribe to Algorithms course to access the code.







Instructor:



If you have any feedback, please use this form: https://thealgorists.com/Feedback.




Subscribe to Our Youtube Channel

Follow Us On LinkedIn
wave