[Python] Simple O(n+k) solution
\nimport math\nfrom collections import defaultdict\nclass Solution:\n    def minMoves(self, arr: List[int], k: int) -> int:\n        n = len(arr)\n        ans =
```\nimport math\nfrom collections import defaultdict\nclass Solution:\n    def minMoves(self, arr: List[int], k: int) -> int:\n        n = len(arr)\n        ans = math.inf\n        maxval = []\n        minval = []\n        d = defaultdict(int)\n        val = int(math.ceil(n/2))\n        for i in range(val):\n            mn = min(arr[i],arr[n-i-1])\n            mx = max(arr[i],arr[n-i-1])\n            d[mn+mx] += 1\n            minval.append(mn)\n            maxval.append(mx)\n        minval.sort()\n        maxval.sort()\n        i = 0\n        j = 0\n        for x in range(2,2*k+1):\n            while i < len(maxval) and maxval[i] < x-k:\n                i += 1\n            mp1 = i\n            while j < len(minval) and minval[j] < x:\n                j += 1\n            mp2 = j\n            rep2 = mp1 + ((n//2) - mp2)\n            rep0 = d[x]\n            rep1 = (n//2) - rep2 - rep0\n            ans = min(ans,rep2*2 + rep1)\n        return ans\n```
[]