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

        int n = nums.length;
        int[] right = new int[n];
        right[n - k] = n - k;
        for (int i = n - k - 1, total = presum[n] - presum[n - k]; i>= 0; i--) {
            int sum = presum[i + k] - presum[i]; 
            if (sum >= total) {
                right[i] = i;
                total = sum;
            } else right[i] = right[i + 1];
        }
        return right;
    }
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 ] ;
  var_5 [ var_4 - var_2 ] = var_4 - var_2 ;
  for ( int var_7 = var_4 - var_2 - 1 , var_8 = var_1 [ var_4 ] - var_1 [ var_4 - var_2 ] ;
  var_7 >= 0 ;
  var_7 -- ) {
    int var_10 = var_1 [ var_7 + var_2 ] - var_1 [ var_7 ] ;
    if ( var_10 >= var_8 ) {
      var_5 [ var_7 ] = var_7 ;
      var_8 = var_10 ;
    }
    else var_5 [ var_7 ] = var_5 [ var_7 + 1 ] ;
  }
  return var_5 ;
}
