C++
\nclass Solution {\npublic:\n    int minMoves(vector<int>& nums, int limit) {\n        vector<int>diff(2*limit+2) ;\n        int n = nums.size() ;\n        for(
```\nclass Solution {\npublic:\n    int minMoves(vector<int>& nums, int limit) {\n        vector<int>diff(2*limit+2) ;\n        int n = nums.size() ;\n        for(int i = 0; i < n/2 ; i++){\n            int a = min(nums[i], nums[n-1-i]) ;\n            int b = max(nums[i], nums[n-1-i]) ;\n            diff[2] += 2 ;\n            diff[a+1] -= 1 ;\n            diff[a+b] -= 1 ;\n            diff[a+b+1] += 1 ;\n            diff[limit + b + 1] += 1 ; \n        }\n        int ret = INT_MAX ;\n        int y = 0 ;\n        for(int x = 2; x <= 2 * limit; x++){\n            y += diff[x] ;\n            ret = min(ret, y) ;\n        }\n        return ret ;\n    }\n};\n```
[]