Solution to the largest sub matrix problem.