Compute sum of all values . We don 't  acutally rotation the array, but  compute sum by finding ndexes when  arr[i] is first element
for j in range ( 0 , n ) : NEW_LINE INDENT index = int ( ( i + j ) % n ) NEW_LINE curr_sum += j * arr [ index ] NEW_LINE DEDENT