import java.util.*; public class SubMatrixSum{ private int[][] arr; private int[][] compress; public SubMatrixSum(int[][] _arr){ arr = _arr; getCompress(); } private void getCompress(){ int N=arr.length; int M = arr[0].length; compress = new int[N][M]; for (int i=0; i stack = new Stack (); int[][] result = new int[temp.length][2]; for (int i=0; i