C++ | Easy to understand | With Explanation
Minimum Operations to make array equal will be to make all the elments equal to mid of the array.\nSo, the result will be to find the diff (n-arr[i]) till mid o
Minimum Operations to make array equal will be to make all the elments equal to mid of the array.\nSo, the result will be to find the diff (n-arr[i]) till mid of the array\n    1 - 1\n    2 - 1,3 - 2,2\n    3 - 1,3,5 - 2,3,4, - 3,3,3\n    4 - 1,3,5,7 - 2,3,5,6- 3,3,4,6 - 3,4,4,5 - 4,4,4,4\n    5 - 1,3,5,7,9 - 2,3,5,7,8 - 3,3,5,7,7 - 4,3,5,7,6 - 5,3,5,7,5 - 5,4,5,6,5 - 5,5,5,5,5\n```\n    int minOperations(int n) {\n        int res = 0;\n        for(int i =0; i < n/2;i++)\n        {\n            res += n-(2*i + 1);\n        }\n        return res;\n    }
[]