public NumMatrix(int[][] matrix) {
            if (matrix == null || matrix.length == 0 || matrix[0].length == 0) return;
            m = matrix;
            for (int i = 0; i < matrix.length; ++i) {
                for (int j = 0; j < matrix[0].length; ++j) {
                    m[i][j] += m(i - 1, j) + m(i, j - 1) - m(i - 1, j - 1);
                }
            }
        }