C++ Solution with explanation
Explanation :\n1) Given array is of odd consecutive numbers and sum of odd consecutive numbers is always equal to square of there count,\nExample --> 1 + 3 + 5 
Explanation :\n1) Given array is of odd consecutive numbers and sum of odd consecutive numbers is always equal to square of there count,\nExample --> 1 + 3 + 5 is 9 && 1 + 3 + 5 + 7 is 16.\n2) In one operation we can decrease one number and increase other number.\n3) We have to make array equal and there can be only one number to which we can convert all elements of our array, that would be the (n), because total sum is (n * n) and we have to make all values or numbers equal.\n4) If we count number of operations on each number we have to perform to make our number equal to n, we found out, we will find our ans.\n5) one operation is decreasing a number and increasing other number, so we can take sum of operations that requires numbers to be added into them or sum of operations that requires to be subtrated fromt hem.\nExample --> 1, 3, 5, 7. Here for 1 => 3 operations of add , for 3 => 1 operation of add , for 5 => 1 operation of subtract and for 7 => 3 operations of subtract.\nWe can observe count of add operations is equal to subtract operations and we have our given operation in which we can add to one and subtract to other, so ther answer is self explained here.\n\nI hope this will help you in solving this problem.\n\nPLEASE UPVOTE IF YOU LIKE MY ANSWER.\n\n\n```\nclass Solution {\npublic:\n    int minOperations(int n) {\n        return (n * n) / 4;\n    }\n};\n```
[]