```
class Solution(object):
def maxRotateFunction(self, A):
sumA=sum(A)
temp=0
for i,c in enumerate(A):
temp+=i*c
maxx=temp
for j in xrange(len(A)):
temp+=(len(A)*A[j]-sumA)
maxx=max(temp,maxx)
return maxx
```

First you get the temp by multiplyng each index and value. Then for each time you rotate index by clockwise, it's interesting to see the sum increases by len(A)*A[j]-sum. And you just need to find the max one.
For instance, you have INDEX of [0,1,2,3,4,5], next it changes to [5,0,1,2,3,4], the temp increases by 5*first index's value i by 5*A[j] - the rest numbers' sum, which means the temp increses by 6(the length of A) * A[j] - the total number's sum. Because other numbers' index just "decreased" by one, expect the one whose "last" index was 0.