Java Simple and easy TO(1), SO(1) solution, 0 ms, faster than 100.00%, clean code with comments
PLEASE UPVOTE IF YOU LIKE THIS SOLUTION\n\n\nclass Solution {\n    public int minOperations(int n) {\n        \n        // 1  3  5  7  9 arr[i]\n        // 0  1
**PLEASE UPVOTE IF YOU LIKE THIS SOLUTION**\n\n```\nclass Solution {\n    public int minOperations(int n) {\n        \n        // 1  3  5  7  9 arr[i]\n        // 0  1  2  3  4\n        // n = 5, half =  5 / 2 = 2\n        \n        //sum =  (5 - 1) +  (5 - 3) \n        //.   =  (5 + 5) -  (1 + 3)\n        //.   =  (n * 2) -  (sum of first n / 2  odd number)\n        \n        int half = (n / 2);\n        \n        return (n * half) - getSeriesSum(1, 2, half);\n    }\n                                \n    private int getSeriesSum(int a, int d, double n){\n        //Arithmetic Progressions\n        //The sum to n terms of an arithmetic progression\n        //This is given by:\n        //Sn = \xBD n [ 2a + (n - 1)d ]\n        //  where d = common difference, a = first term\n        \n        \n        return (int)((n / 2) * (2 * a + (n - 1)  * d));\n    }   \n}\n                                \n  \n```
['Java']