public int maximalRectangleON2(char[][] matrix) {
		if(matrix == null || matrix.length == 0 || matrix[0].length == 0) return 0;
		
		int m = matrix.length, n = matrix[0].length;
		int[][] ones = new int[m][n];
		
		for(int i = 0; i < m; i++) {
			ones[i][n-1] = (matrix[i][n-1] == '1') ? 1 : 0;
			for(int j = n-2; j >= 0; j--) {
				if(matrix[i][j] == '0') ones[i][j] = 0;
				else ones[i][j] = ones[i][j+1] + 1;
			}
		}
		
		int max = 0;
		for(int j = 0; j < n; j++) {
			int temp = maxRectangle(j, ones);
			if(temp > max) max = temp;
		}
		return max;
	}