Simple C++ code
\nint minMoves_v2(vector<int>& nums, int limit) {\n\n\tvector<int> vec1(limit * 2 + 2, 0), vec2(limit * 2 + 2, 0);\n\n\tint n = nums.size();\n\n\tfor (int i = 0
```\nint minMoves_v2(vector<int>& nums, int limit) {\n\n\tvector<int> vec1(limit * 2 + 2, 0), vec2(limit * 2 + 2, 0);\n\n\tint n = nums.size();\n\n\tfor (int i = 0; 2 * i < n - 1; ++i) {\n\t\tvec2[nums[i] + nums[n - i - 1]]++;\n\n\t\tvec1[min(nums[i], nums[n - i - 1]) + 1]++;\n\t\tvec1[max(nums[i], nums[n - i - 1]) + limit + 1]--;\n\t}\n\n\tint res = n;\n\tint curr = 0;\n\n\tfor (int i = 2; i <= limit * 2; ++i) {\n\n\t\tcurr += vec1[i];\n\n\t\tint val = (n / 2  - curr) * 2 + curr - vec2[i];\n\n\t\tres = min(res, val);\n\n\t}\n\n\treturn res;\n}\n```
[]