Handle Odd And Even Index elements separetely
\nclass Solution {\n\tpublic int minOperations(int n) {\n\t\tint sum = 0;\n\t\tif (n % 2 == 0) {\n\t\t\tfor (int i = 1; i < n; i = i + 2) {\n\t\t\t\tsum += i;\n
```\nclass Solution {\n\tpublic int minOperations(int n) {\n\t\tint sum = 0;\n\t\tif (n % 2 == 0) {\n\t\t\tfor (int i = 1; i < n; i = i + 2) {\n\t\t\t\tsum += i;\n\t\t\t}\n\t\t\treturn sum;\n\t\t} else {\n\t\t\tfor (int i = 0; i < n; i = i + 2) {\n\t\t\t\tsum += i;\n\t\t\t}\n\t\t\treturn sum;\n\t\t}\n\t}\n}\n```
['Java']