[Python] O(n+limit) method
We first traverse the nums list to generate 3 lists:\n\nup[i] stores the number of pairs whose sum can reach i upward in one move.  For example, if limit=4, pai
We first traverse the nums list to generate 3 lists:\n\nup[i] stores the number of pairs whose sum can reach i upward in one move.  For example, if limit=4, pair[1,2]\'s sum can reach 6 upward in one move.\n\ndown[i] stores the number of pairs whose sum can reach i downward in one move.  For example, pair[1,2]\'s sum can reach 2 downward in one move.\n\ntotal[i] stores the number of pairs whose sum is i.\n\nConsequently, let x(a) be the total moves required if we want to make the nums list "complementary" at the pair sum of a.\n\nWe can have x(a)=x(a-1)+total[a-1]-total[a]+up[a-1]-down[a].\n\n```\nclass Solution:\n    def minMoves(self, nums: List[int], limit: int) -> int:\n        n=len(nums)\n        a=n//2\n        up=[0 for i in range(2*limit+1)]\n        down=[0 for i in range(2*limit+1)]\n        total=[0 for i in range(2*limit+1)]\n        candidate=[0 for i in range(a)]\n        for i in range(a):\n            s=nums[i]+nums[n-1-i]\n            mn=min(nums[i],nums[n-1-i])\n            mx=max(nums[i],nums[n-1-i])\n            candidate[i]=[s,mn,mx]\n            up[s+limit-mn]+=1\n            down[s-mx+1]+=1\n            total[s]+=1\n        res=float("inf")\n        count=0\n\t\t\n\t\t# count first records the number of moves required for sum=2\n        for j in range(a):\n            diff=candidate[j][0]-2\n            if diff>0:\n                if candidate[j][2]-1>=diff:\n                    count+=1\n                else:\n                    count+=2\n            if diff<0:\n                if limit-candidate[j][1]>=-diff:\n                    count+=1\n                else:\n                    count+=2 \n\t\t\n        res=min(res,count)\n\t\t\n\t\t#Then we traverse the sum space to find the minimum moves\n        for i in range(3,2*limit+1):\n            count+=up[i-1]\n            count-=down[i]\n            count+=total[i-1]\n            count-=total[i]\n            res=min(res,count)\n        return res\n            \n```
[]