Largest submatrix with equal no of 1's and 0's
问题 Given a matrix of size mxn containing 0's and 1's only. I need to find the largest sub-matrix which has equal number of 1's and 0's in it. Brute force approach would be O(m^2*n^2) Can we do any better than this? I tried applying dynamic programming, but couldn't find any optimal substructure to it. I believe a similar one-dimensional version of this problem was discussed here: Space-efficient algorithm for finding the largest balanced subarray? which has an O(n) solution using some extra