Java | Easy | 100% | 0ms
Please Upvote\n\n\nRuntime: 0 ms, faster than 100.00% of Java online submissions for Minimum Operations to Make Array Equal.\nMemory Usage: 39.3 MB, less than 9
# Please Upvote\n\n```\nRuntime: 0 ms, faster than 100.00% of Java online submissions for Minimum Operations to Make Array Equal.\nMemory Usage: 39.3 MB, less than 94.03% of Java online submissions for Minimum Operations to Make Array Equal.\n```\n\n```\n    public int minOperations(int n) {\n        int count = 0;\n        if(n <= 3)\n            return n - 1;\n        int diff = n - 1;\n        if((diff & 1) == 1){\n            count = (n / 2) * (n / 2);\n        }else\n            count = (n / 2) * ((n / 2) + 1);\n        return count;\n    }\n```
['Math', 'Java']