Java O(Math.max(limit,N)) with detailed explanation
Count sum, min and max number in pairs.\n2. Pre-process min as greater or equals than by sum from right to left\n3. Pre-process max as less than by sum from lef
1. Count `sum`, `min` and `max` number in pairs.\n2. Pre-process `min` as greater or equals than by sum from right to left\n3. Pre-process `max` as less than by sum from left to right\n3. For `sum` between `2` and `limit*2`\n\t* init operation required as `length/2`\n\t* reduce matched `sum`\n\t* add 1 extra for pairs with `min` is greater than or equals `sum`, since it requirs modify both of the numbers\n\t* add 1 extra for pairs with `max` is less than `sum`, since it requirs modify both of the numbers\n\n```\nclass Solution {\n    public int minMoves(int[] nums, int limit) {\n        int[] sums=new int[2*limit+1],mins=new int[limit+1],maxs=new int[limit+1];\n        for(int i=0;i<nums.length/2;i++) {\n            int a=nums[i],b=nums[nums.length-1-i];\n            int sum=a+b,min=Math.min(a,b),max=Math.max(a,b);\n            sums[sum]++;\n            mins[min]++;\n            maxs[max]++;\n        }\n        \n        for(int i=1;i<=limit;i++) {\n            // sum maxs left to right\n            maxs[i]+=maxs[i-1];\n            // sum mins right to left\n            mins[limit-i]+=mins[limit-i+1];\n        }\n        \n        var k=nums.length;\n        for(int i=2;i<=limit*2;i++) {\n            // initial change with length/2 and remove matched sums\n            var change=nums.length/2-sums[i];\n            // if min >= i, we need to change both, so add 1 extra\n            if (i<=limit) change+=mins[i];\n            // if max < i-limit, we need to change both, so add 1 extra\n            if (i>limit) change+=maxs[i-limit-1];\n            k=Math.min(k,change);\n        }\n        return k;\n    }\n}\n```
[]