public int maxProduct(int[] A) {
        int length = A.length;
        int max = 0;
        if(length == 1)
            return A[0];
        if(A== null || A.length ==0 )
            return 0;
        int index = 0;
        for(int i = 0; i < length; i++){
            if(A[i] == 0 ){
                max = Math.max(max,maxP(Arrays.copyOfRange(A,index,i)));
                index = i+1;
            }
        }

        max = Math.max(max,maxP(Arrays.copyOfRange(A,index,A.length)));
        return  max;

    }