Pergunta de entrevista da empresa OYO

Maximise sum of i*a[i] in a array where we can only do array rotation