<awangdev>689. Maximum Sum of 3 Non-Overlapping Subarrays_1.java
private int[] calcLeft(int[] nums, int[] presum, int k) {

        int n = nums.length;
        int[] left = new int[n];
        for (int i = k, total = presum[k] - presum[0]; i < n; i++) {
            int sum = presum[i + 1] - presum[i + 1 - k]; 
            if (sum > total) {
                left[i] = i + 1 - k;
                total = sum;
            } else left[i] = left[i - 1];
        }
        
        return left;
    }
private int [ ] sample_funcname ( int [ ] var_0 , int [ ] var_1 , int var_2 ) {
  int var_4 = var_0 . length ;
  int [ ] var_5 = new int [ var_4 ] ;
  for ( int var_6 = var_2 , var_8 = var_1 [ var_2 ] - var_1 [ 0 ] ;
  var_6 < var_4 ;
  var_6 ++ ) {
    int var_10 = var_1 [ var_6 + 1 ] - var_1 [ var_6 + 1 - var_2 ] ;
    if ( var_10 > var_8 ) {
      var_5 [ var_6 ] = var_6 + 1 - var_2 ;
      var_8 = var_10 ;
    }
    else var_5 [ var_6 ] = var_5 [ var_6 - 1 ] ;
  }
  return var_5 ;
}
