Java || O(1) TC & SC || Simplest & easy || Maths
We have to only get a Sharp observation in this question to get the solution in O(1) Time complexity, So, \nValues of n      =  1, 2, 3, 4, 5, 6,  7,  8,   9,  
We have to only get a Sharp observation in this question to get the solution in O(1) Time complexity, So, \nValues of n      =  1, 2, 3, 4, 5, 6,  7,  8,   9,   10,  11, 12, 13, 14, 15...\nExpected ans =  0, 1, 2, 4, 6,  9, 12, 16, 20, 25, 30,  36, 42, 49, 56...\nWe can observe that , when n is even it is simply the Square of (n/2),\nwhen it is odd it is Square of (n/2) + (n/2) \n\n```\nclass Solution {\n    public int minOperations(int n) {\n        if(n%2==0){\n            return (int)Math.pow(n/2,2);\n        }\n        else{\n            return ((int)Math.pow(n/2,2))+n/2;\n        }\n    }\n}\n```\nKindly upvote If you liked the explanation!!!
['Math', 'Java']