Maximum size square sub matrix with all 1s in a binary matrix
Given a matrix of size M x N which contains only 0s and 1s, How do we find the largest square sub-matrix which contains all 1s. For example in the following example, highlighted portion indicates a 3×3 square sub-matrix with all 1s. 1 0 0 1 1 0 0 1 1 1 1 1 0…