public static int maximalRectangle(char[][] matrix) {
    	if (null == matrix || 0 == matrix.length) return 0; 
    	for (int i = 1; i < matrix.length; i++) {
    		for (int j = 0; j < matrix[i].length; j++) {
    			if ('1' == matrix[i][j]) {
    				matrix[i][j] = (char) (matrix[i][j] + matrix[i - 1][j] - '0');
    			}
    		}
    	}
    	int max = 0;
    	int[] height = new int[matrix[0].length];
    	for (int i = 0; i < matrix.length; i++) {
    		for (int j = 0; j < matrix[i].length; j++) {
    			height[j] = matrix[i][j] - '0';
    		}
    		int ret = largestRectangleArea(height);
    		if (ret > max) max = ret; 
    	}
        return max;
    }