java solution easy to understand !
java Code\n\nclass Solution {\n    public int minOperations(int n) {\n       int avg =0;\n       int sum =0;\n       int count=0;\n       \n        for(int i=0;
# java Code\n```\nclass Solution {\n    public int minOperations(int n) {\n       int avg =0;\n       int sum =0;\n       int count=0;\n       \n        for(int i=0; i<n; i++){\n          sum += (2 * i) +1;\n        }\n        avg = sum/n;\n\n        for(int i=0; i<n; i++){\n            int no = (2*i) +1;\n            if(no < avg){\n                count += (avg - no);\n            }\n        }\n        return count;\n      \n    }\n}\n```
['Java']