title: Maximum Sum Iarri Among Rotations Given Array
signature: function maximum_sum_iarri_among_rotations_given_array(arr, n)
source_py: def maximum_sum_iarri_among_rotations_given_array(arr, n):
      res = (- sys.maxsize)
      for i in range(0, n):
          curr_sum = 0
          for j in range(0, n):
              index = int(((i + j) % n))
              curr_sum += (j * arr[index])
          res = max(res, curr_sum)
      return res
source_cpp: int maximum_sum_iarri_among_rotations_given_array(vector<int> arr, int n) {
    int res = INT_MIN;
    for ( int i = 0;
    i < n;
    i ++ ) {
      int curr_sum = 0;
      for ( int j = 0;
      j < n;
      j ++ ) {
        int index = ( i + j ) % n;
        curr_sum += j * arr [ index ];
      }
      res = max ( res, curr_sum );
    }
    return res;
  }