You are given a matrix having 0s & 1s where each row & column is sorted also. So need to find the maximum matrix of 1s.
e.g. Below is the given matrix, note each row & column is sorted.
{0,0,0,0,1}
{0,0,0,1,1}
{0,1,1,1,1}
{0,1,1,1,1}
{1,1,1,1,1}
so max matrix having 1s can be-
1,1,1,1
1,1,1,1
1,1,1,1