Java easiest solution only 3 lines O(n/2)
public static int minOperations(int n) {\n\tint res = 0;\n\tfor (int i = 1; i < n; i += 2)\n\t\tres += n - i;\n\n\treturn res;\n}
public static int minOperations(int n) {\n\tint res = 0;\n\tfor (int i = 1; i < n; i += 2)\n\t\tres += n - i;\n\n\treturn res;\n}
[]