@@ -0,0 +1,809 @@
+/***%0A * Find the contiguous subarray within an array (containing at least one number) which has the largest product.%0A *%0A * For example, given the array %5B2,3,-2,4%5D,%0A * the contiguous subarray %5B2,3%5D has the largest product = 6.%0A */%0Apublic class Solution %7B%0A    // Solution 1: O() %0A    public int maxProduct(int%5B%5D A) %7B%0A        if (A == null %7C%7C A.length == 0)%0A            return 0;%0A        int max_local = A%5B0%5D;%0A        int min_local = A%5B0%5D;%0A        int global = A%5B0%5D;%0A        for (int i = 1; i %3C A.length; i++) %7B%0A            int max_temp = max_local;%0A            max_local = Math.max(Math.max(A%5Bi%5D * max_local, A%5Bi%5D), A%5Bi%5D * min_local);%0A            min_local = Math.min(Math.min(A%5Bi%5D * max_temp, A%5Bi%5D), A%5Bi%5D * min_local);%0A            global = Math.max(global, max_local);%0A        %7D%0A        return global;%0A    %7D%0A%7D%0A

add MaximumProductSubarray.java