Maximize the sum of array[i]*i

Given an array of N integer, we have to maximize the sum of arr[i] * i, where i is the index of the element (i = 0, 1, 2, ..., N). We can rearrange the position of the integer in the array to maximize the sum.


This is a companion discussion topic for the original entry at http://iq.opengenus.org/maximize-sum-of-array-i/