[C++] Simplest Intuitive Solution
We just have to make all the elements equal to the sumOfAll/2 or (first + last)/2 (Both are the same since they\'re consecutive odd numbers).\n That is the mini
* We just have to make all the elements equal to the sumOfAll/2 or (first + last)/2 (Both are the same since they\'re consecutive odd numbers).\n* That is the minimum no. of operations performed.\n* So traverse the first half of the array and add target - arr[i] to the ans (Since arr[x] + 1 & arr[y] - 1 are counted as one operation and x ---> belongs to the first half & y ---> belongs to the second half).\n\n**Code :**\n```\nclass Solution {\npublic:\n    int minOperations(int n) {\n        int target = (1 + 2*(n-1) + 1)/2, min_op=0;\n        for(int i=0; i<n/2; i++) min_op += target - (2*(i) + 1);\n        \n        return min_op;\n    }\n};\n```\n\n**Time Complexity :** O(n/2)
['C', 'C++']