Given a binary matrix, find out the maximum size rectangular sub-matrix with all 1

consider the below binary matrix.

0 1 1 0 0
1 1 0 1 0
1 1 1 1 1
1 1 1 1 1
1 1 1 1 0
0 0 0 0 0

Then the result should be

1 1 1 1 1
1 1 1 1 1
Click for Solution
[Insert Code]