public int maximalRectangle(char[][] matrix) {
        if (matrix.length == 0) return 0;
        if (matrix[0].length == 0) return 0;
        if (matrix.length == 1) {
            int _max = 0;
            int len = 0;
            for (int j = 0; j < matrix[0].length; j++) {
                if (matrix[0][j] == '0') {
                    len = 0;
                } else {
                    len += 1;
                    _max = Math.max(_max, len);
                }
            }
            return _max;
        }
        int[][] matrix_int = new int[matrix.length][matrix[0].length]; // new matrix
        for (int i = 0; i < matrix.length; i++) {
        	int len = 0;
            for (int j = 0; j < matrix[i].length; j++) {
                if (matrix[i][j] == '0') {
                    len = 0;
                } else {
                    len += 1;
                    matrix_int[i][j] = len;
                }
            }
        }
        // find largest rectangle column by column
        int _max = 0;
        for (int i = 0; i < matrix_int[0].length; i++) {
            int[] column = columnCopy(matrix_int, i);
            int row_max = largestRectangle(column);
            _max = Math.max(_max, row_max);
        }
        return _max;
    }