<awangdev>Maximum Subarray II_4.java
public int maxTwoSubArrays(ArrayList<Integer> nums) {
        if (nums == null || nums.size() == 0) {
            return 0;
        }

        int preSum = 0;
        int minPreSum = 0;
        int max = Integer.MIN_VALUE;
        int n = nums.size();
        int[] left = new int[n];
        int[] right = new int[n];
        for (int i = 0; i < n; i++) {
            preSum += nums.get(i);
            max = Math.max(max, preSum - minPreSum);
            minPreSum = Math.min(minPreSum, preSum);
            left[i] = max;
        }
        preSum = 0;
        minPreSum = 0;
        max = Integer.MIN_VALUE;
        for (int i = n - 1; i >= 0; i--) {
            preSum += nums.get(i);
            max = Math.max(max, preSum - minPreSum);
            minPreSum = Math.min(minPreSum, preSum);
            right[i] = max;
        }
        max = Integer.MIN_VALUE;
        for (int i = 0; i < n - 1; i++) {
            int rst = left[i] + right[i + 1];
            max = Math.max(max, rst);
        }

        return max;
    }
public int sample_funcname ( ArrayList < Integer > var_2 ) {
  if ( var_2 == null || var_2 . size ( ) == 0 ) {
    return 0 ;
  }
  int var_6 = 0 ;
  int var_7 = 0 ;
  int max = Integer . MIN_VALUE ;
  int var_10 = var_2 . size ( ) ;
  int [ ] var_11 = new int [ var_10 ] ;
  int [ ] var_12 = new int [ var_10 ] ;
  for ( int var_13 = 0 ;
  var_13 < var_10 ;
  var_13 ++ ) {
    var_6 += var_2 . get ( var_13 ) ;
    max = Math . max ( max , var_6 - var_7 ) ;
    var_7 = Math . min ( var_7 , var_6 ) ;
    var_11 [ var_13 ] = max ;
  }
  var_6 = 0 ;
  var_7 = 0 ;
  max = Integer . MIN_VALUE ;
  for ( int var_13 = var_10 - 1 ;
  var_13 >= 0 ;
  var_13 -- ) {
    var_6 += var_2 . get ( var_13 ) ;
    max = Math . max ( max , var_6 - var_7 ) ;
    var_7 = Math . min ( var_7 , var_6 ) ;
    var_12 [ var_13 ] = max ;
  }
  max = Integer . MIN_VALUE ;
  for ( int var_13 = 0 ;
  var_13 < var_10 - 1 ;
  var_13 ++ ) {
    int var_18 = var_11 [ var_13 ] + var_12 [ var_13 + 1 ] ;
    max = Math . max ( max , var_18 ) ;
  }
  return max ;
}
