Python (Simple Sweep Line Algorithm)
\n    def minMoves(self, nums, limit):\n        n, ans = len(nums), [0](2limit + 2)\n        \n        for i in range(len(nums)//2):\n            m = min(nums[i
\n    def minMoves(self, nums, limit):\n        n, ans = len(nums), [0]*(2*limit + 2)\n        \n        for i in range(len(nums)//2):\n            m = min(nums[i], nums[n-1-i]) + 1\n            M = max(nums[i], nums[n-1-i]) + limit\n            ans[m] -= 1\n            ans[M + 1] += 1\n            ans[nums[i] + nums[n-1-i]] -= 1\n            ans[nums[i] + nums[n-1-i] + 1] += 1\n            \n        for i in range(1, len(ans)):\n            ans[i] += ans[i-1]\n            \n        return n + min(ans)
[]