Can anyone help me to solve this question ?
118

Given an array containing numbers represented in the form of 2*i+1, where i represents the index. Find the optimal number of operations required to make all the numbers equal, if at a time you can add 1 to a number and subtract 1 from the other.
Ex : if n = 5 , arr : = [1,3,5,7,9];
I know this is pretty basic question but still I find it difficult to solve.Please help.

Comments (1)