[Python] Explained simple solution, runtime beats 90% and memory beats 75%
Observe that:\nWhen n=2, array is [1, 3], we need 1*1 operations.\nWhen n=3, array is [1, 3, 5], we need 1*2 operations.\nWhen n=4, array is [1, 3, 5, 7], we ne
Observe that:\nWhen `n=2`, array is `[1, 3]`, we need `1*1` operations.\nWhen `n=3`, array is `[1, 3, 5]`, we need `1*2` operations.\nWhen `n=4`, array is `[1, 3, 5, 7]`, we need `2*2` operations.\nWhen `n=5`, array is `[1, 3, 5, 7, 9]`, we need `2*3` operations.\nWhen `n=6`, array is `[1, 3, 5, 7, 9, 11]`, we need `3*3` operations.\nAnd so on.\n\nThe idea is that we need to exchange `floor(n/2)` pairs of numbers on an average of `ceil(n/2)` times. Since `floor(n/2)+ceil(n/2)=n` for any integer, we can solve the problem by:\n```\nclass Solution:\n    def minOperations(self, n: int) -> int:\n        half = int(n/2)\n        return half*(n-half)\n```
[]