java sweep line 100%
```\nclass Solution {\n    public int minMoves(int[] nums, int limit) {\n        int len = nums.length;\n        int[] cnt = new int[limit2+2];\n        for(int
```\nclass Solution {\n    public int minMoves(int[] nums, int limit) {\n        int len = nums.length;\n        int[] cnt = new int[limit*2+2];\n        for(int i=0; i<len/2; i++){\n            int a = Math.min(nums[i], nums[len-1-i]);\n            int b = Math.max(nums[i], nums[len-1-i]);\n            cnt[2]+=2;\n            cnt[a+1]--;\n            cnt[a+b]--;\n            cnt[a+b+1]++;\n            cnt[b+limit+1]++;\n        }\n        int min = len;\n        int prefix = 0;\n        for(int i=2; i<2*limit+2; i++){\n            prefix+=cnt[i];\n            min = Math.min(min, prefix);\n        }\n        return min;\n    }\n}
[]