@@ -0,0 +1,1301 @@
+package leetcode.maximum_product_subarray;%0A%0Apublic class Solution %7B%0A    public int maxProduct(int%5B%5D A) %7B%0A    %09int max = A%5B0%5D;%0A    %09int start = 0, end = 0;%0A    %09for(int i = 0; i %3C A.length; i++)%7B%0A    %09%09if(A%5Bi%5D %3E max) max = A%5Bi%5D;%0A    %09%09if(A%5Bi%5D == 0)%7B%0A    %09%09%09end = i - 1;%0A    %09%09%09if(start %3C= end)%7B%0A    %09%09%09%09int product_forward = 1;%0A    %09%09%09%09int product_backward = 1;%0A    %09%09%09%09for(int j = 0; j %3C= end - start; j++)%7B%0A    %09%09%09%09%09product_forward *= A%5Bstart + j%5D;%0A    %09%09%09%09%09product_backward *= A%5Bend - j%5D;%0A    %09%09%09%09%09if(product_forward %3E max)%7B%0A    %09%09%09%09%09%09max = product_forward;%0A    %09%09%09%09%09%7D%0A    %09%09%09%09%09if(product_backward %3E max)%7B%0A    %09%09%09%09%09%09max = product_backward;%0A    %09%09%09%09%09%7D%0A    %09%09%09%09%7D%0A    %09%09%09%7D%0A    %09%09%09start = i + 1;%0A    %09%09%7D%0A    %09%7D%0A    %09if(start %3C A.length)%7B%0A    %09%09end = A.length - 1;%0A%09%09%09if(start %3C= end)%7B%0A%09%09%09%09int product_forward = 1;%0A%09%09%09%09int product_backward = 1;%0A%09%09%09%09for(int j = 0; j %3C= end - start; j++)%7B%0A%09%09%09%09%09product_forward *= A%5Bstart + j%5D;%0A%09%09%09%09%09product_backward *= A%5Bend - j%5D;%0A%09%09%09%09%09if(product_forward %3E max)%7B%0A%09%09%09%09%09%09max = product_forward;%0A%09%09%09%09%09%7D%0A%09%09%09%09%09if(product_backward %3E max)%7B%0A%09%09%09%09%09%09max = product_backward;%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D%0A%09%09%09%7D%0A    %09%7D%0A    %09return max;%0A    %7D%0A    %0A    public static void main(String%5B%5D args)%7B%0A    %09int ans = new Solution().maxProduct(new int%5B%5D%7B-2, 0, -1%7D);%0A    %09System.err.println(%22ans = %22 + ans);%0A    %7D%0A%7D%0A

Add java solution for 152. Maximum Product Subarray