for ith in nums, minCurr just means the min product to i-1

maxCurr just means the max product to i-1

the maxCurr,minCurr can only get from maxCurr*curr,minCurr*curr,curr

'''

public class Solution {

public int maxProduct(int[] nums) {

int res = nums[0];

int minCurr = nums[0];

int maxCurr = nums[0];

for(int i=1;i<nums.length;i++){

int curr = nums[i];

int nMinCurr = Math.min(maxCurr*curr,Math.min(minCurr*curr,curr));

int nMaxCurr = Math.max(minCurr*curr,Math.max(maxCurr*curr,curr));

minCurr = nMinCurr;

maxCurr = nMaxCurr;

if(maxCurr>res){

res = maxCurr;

}

}

return res;

}

}

''''