<gouthampradhan>dynamic_programming_MaximumProductSubarray_1.java
public int maxProduct(int[] nums) {
    if (nums.length == 1) return nums[0];
    int min = nums[0];
    int max = nums[0];
    int result = max;
    for (int i = 1; i < nums.length; i++) {
      int prevMin = min, prevMax = max;
      min = Math.min(nums[i], Math.min(nums[i] * prevMin, nums[i] * prevMax));
      max = Math.max(nums[i], Math.max(nums[i] * prevMin, nums[i] * prevMax));
      result = Math.max(result, max);
    }
    return result;
  }
public int sample_funcname ( int [ ] var_0 ) {
  if ( var_0 . length == 1 ) return var_0 [ 0 ] ;
  int min = var_0 [ 0 ] ;
  int max = var_0 [ 0 ] ;
  int var_6 = max ;
  for ( int var_7 = 1 ;
  var_7 < var_0 . length ;
  var_7 ++ ) {
    int var_8 = min , var_9 = max ;
    min = Math . min ( var_0 [ var_7 ] , Math . min ( var_0 [ var_7 ] * var_8 , var_0 [ var_7 ] * var_9 ) ) ;
    max = Math . max ( var_0 [ var_7 ] , Math . max ( var_0 [ var_7 ] * var_8 , var_0 [ var_7 ] * var_9 ) ) ;
    var_6 = Math . max ( var_6 , max ) ;
  }
  return var_6 ;
}
