Java o(n) and o(1)
\nclass Solution {\n    public int minOperations(int n) {\n        \n        int start = 1, end = (n-1) * 2 + 1;\n        int ans = 0;\n        while(start < en
```\nclass Solution {\n    public int minOperations(int n) {\n        \n        int start = 1, end = (n-1) * 2 + 1;\n        int ans = 0;\n        while(start < end)\n        {\n            ans += (end - start) / 2;\n            start += 2;\n            end -= 2;\n        }\n        return ans;\n    }\n}\n```
[]