<gouthampradhan>math_RotateFunction_1.java
public int maxRotateFunction(int[] A) {
    if (A.length == 0 || A.length == 1) return 0;
    int max = Integer.MIN_VALUE;
    int l = A.length;
    int sum = 0, prodSum = 0;
    for (int i = 0; i < l; i++) {
      prodSum += (A[i] * i);
      sum += A[i];
    }
    max = Math.max(max, prodSum);
    for (int i = 0; i < l - 1; i++) {
      prodSum = (prodSum - sum + A[i] + ((l - 1) * A[i]));
      max = Math.max(max, prodSum);
    }
    return max;
  }
public int sample_funcname ( int [ ] var_0 ) {
  if ( var_0 . length == 0 || var_0 . length == 1 ) return 0 ;
  int max = Integer . MIN_VALUE ;
  int var_7 = var_0 . length ;
  int var_8 = 0 , var_9 = 0 ;
  for ( int var_10 = 0 ;
  var_10 < var_7 ;
  var_10 ++ ) {
    var_9 += ( var_0 [ var_10 ] * var_10 ) ;
    var_8 += var_0 [ var_10 ] ;
  }
  max = Math . max ( max , var_9 ) ;
  for ( int var_10 = 0 ;
  var_10 < var_7 - 1 ;
  var_10 ++ ) {
    var_9 = ( var_9 - var_8 + var_0 [ var_10 ] + ( ( var_7 - 1 ) * var_0 [ var_10 ] ) ) ;
    max = Math . max ( max , var_9 ) ;
  }
  return max ;
}
