✅simplest c++ solution with intuition✅
\n# Complexity\n- Time complexity: O(N)\n\n\n- Space complexity: O(1)\n\n\n# Code\n\nclass Solution {\npublic:\n/*\nsum of all n nums is n^2\nmake all element e
\n# Complexity\n- Time complexity: O(N)\n\n\n- Space complexity: O(1)\n\n\n# Code\n```\nclass Solution {\npublic:\n/*\nsum of all n nums is n^2\nmake all element equal to n bcos it will be the optimal choice\ncount the no. of oprns\n*/\n    int minOperations(int n) {\n        int ans=0;\n\n        for(int i=0; i<n/2; i++){\n            ans += (n -(2*i+1));\n        }\n\n        return ans;\n    }\n};\n```
['C++']