<awangdev>Maximum Subarray II_1.java
public int maxTwoSubArrays(List<Integer> nums) {
        if (nums == null || nums.size() == 0) {
            return 0;
        }
        int n = nums.size();
        int[] dpLeft = new int[n + 1];
        int[] dpRight = new int[n + 1];
        dpLeft[0] = 0;
        dpRight[n] = 0;

        int[] maxLeft = new int[n + 1];;
        int[] maxRight = new int[n + 1];
        maxLeft[0] = Integer.MIN_VALUE;
        maxRight[n] = Integer.MIN_VALUE;
        
        for (int i = 1; i <= n; i++) {
            dpLeft[i] = Math.max(dpLeft[i - 1] + nums.get(i - 1), nums.get(i - 1));
            maxLeft[i] = Math.max(maxLeft[i - 1], dpLeft[i]);
        }

        for (int j = n - 1; j >= 0; j--) {
            dpRight[j] = Math.max(dpRight[j + 1] + nums.get(j), nums.get(j));
            maxRight[j] = Math.max(maxRight[j + 1], dpRight[j]);
        }
        
        int max = Integer.MIN_VALUE;
        for (int i = 1; i < n; i++) {
            max = Math.max(max, maxLeft[i] + maxRight[i]);
        }
        
        return max;
    }
public int sample_funcname ( List < Integer > var_2 ) {
  if ( var_2 == null || var_2 . size ( ) == 0 ) {
    return 0 ;
  }
  int var_6 = var_2 . size ( ) ;
  int [ ] var_8 = new int [ var_6 + 1 ] ;
  int [ ] var_9 = new int [ var_6 + 1 ] ;
  var_8 [ 0 ] = 0 ;
  var_9 [ var_6 ] = 0 ;
  int [ ] var_10 = new int [ var_6 + 1 ] ;
  ;
  int [ ] var_11 = new int [ var_6 + 1 ] ;
  var_10 [ 0 ] = Integer . MIN_VALUE ;
  var_11 [ var_6 ] = Integer . MIN_VALUE ;
  for ( int var_13 = 1 ;
  var_13 <= var_6 ;
  var_13 ++ ) {
    var_8 [ var_13 ] = Math . max ( var_8 [ var_13 - 1 ] + var_2 . get ( var_13 - 1 ) , var_2 . get ( var_13 - 1 ) ) ;
    var_10 [ var_13 ] = Math . max ( var_10 [ var_13 - 1 ] , var_8 [ var_13 ] ) ;
  }
  for ( int var_17 = var_6 - 1 ;
  var_17 >= 0 ;
  var_17 -- ) {
    var_9 [ var_17 ] = Math . max ( var_9 [ var_17 + 1 ] + var_2 . get ( var_17 ) , var_2 . get ( var_17 ) ) ;
    var_11 [ var_17 ] = Math . max ( var_11 [ var_17 + 1 ] , var_9 [ var_17 ] ) ;
  }
  int max = Integer . MIN_VALUE ;
  for ( int var_13 = 1 ;
  var_13 < var_6 ;
  var_13 ++ ) {
    max = Math . max ( max , var_10 [ var_13 ] + var_11 [ var_13 ] ) ;
  }
  return max ;
}
