@@ -0,0 +1,710 @@
+package problems;%0A%0Apublic class MaxProductSubarray %7B%0A    public int maxProduct(int%5B%5D A) %7B%0A        if (A.length == 0)%0A            return 0;%0A%0A        int maxProd = Integer.MIN_VALUE;%0A        int max = 1, min = 1;%0A%0A        for (final int a : A) %7B%0A            final int t0 = a * max;%0A            final int t1 = a * min;%0A            max = Math.max(a, Math.max(t0, t1));%0A            min = Math.min(a, Math.min(t0, t1));%0A            maxProd = Math.max(max, maxProd);%0A        %7D%0A        return maxProd;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        MaxProductSubarray mp = new MaxProductSubarray();%0A%0A        final int%5B%5D A = %7B 0, 2, 3, -2, 4, -1, 1 %7D;%0A        System.out.println(mp.maxProduct(A));%0A    %7D%0A%7D%0A

Add Max Prodect Subarray