javascript accumulate delta 135ms
\nconst minMoves = (a, limit) => {\n    let n = a.length, delta = Array(2 * limit + 2).fill(0), res = n, cur = n;\n    for (let i = 0; i < n / 2; i++) {\n      
```\nconst minMoves = (a, limit) => {\n    let n = a.length, delta = Array(2 * limit + 2).fill(0), res = n, cur = n;\n    for (let i = 0; i < n / 2; i++) {\n        let L = a[i], R = a[n - i - 1], min = Math.min(L, R), max = Math.max(L, R);\n        /*\n            The minimum sum (min(l, r) + 1) (oneMoveMin)\n            The maximum sum (max(l, r) + limit) (oneMoveMax)\n            no move to get (l + r) (justGood)\n\n            [~, oneMoveMin - 1]         -2 moves\n            [oneMoveMin, justGood-1]    -1 move\n            [justGood]                   0 move\n            [justGood + 1, oneMoveMax]  -1 move\n            [oneMoveMax + 1, ~]         -2 moves\n        */\n        // for each pair\n        delta[min + 1]--; // oneMoveMin               need 1 less move\n        delta[max + limit + 1]++; // oneMoveMax + 1   need another 1 more move\n        delta[L + R]--; // justGood                   need another 1 less move\n        delta[L + R + 1]++; // justGood + 1           need 1 more move\n    }\n    for (let i = 2; i <= limit * 2; i++) {\n        cur += delta[i];\n        res = Math.min(res, cur);\n    }\n    return res;\n}\n```\nversion 2: 139ms\n```\nconst minMoves = (a, limit) => {\n    let n = a.length, delta = Array(2 * limit + 2).fill(0), res = n, cur = n;\n    for (let i = 0; i < n / 2; i++) {\n        let L = a[i], R = a[n - i - 1], min = Math.min(L, R), max = Math.max(L, R);\n        delta[2] += 2; // difference\n        delta[min + 1]--;\n        delta[max + limit + 1]++;\n        delta[L + R]--;\n        delta[L + R + 1]++;\n    }\n\t// difference\n    for (let i = 1; i < delta.length; i++) delta[i] += delta[i - 1]; // prefix sum\n    for (let i = 2; i <= limit * 2; i++) res = Math.min(res, delta[i]);\n    return res;\n}\n```
['Prefix Sum', 'JavaScript']