segmentation Tree || C++| super easy solution
class Solution {\npublic:\n    int minMoves(vector& nums, int limit) {\n        int n=nums.size();\n        vector vec(2limit+2,0);  // taken a vector of intege
class Solution {\npublic:\n    int minMoves(vector<int>& nums, int limit) {\n        int n=nums.size();\n        vector<int> vec(2*limit+2,0);  // taken a vector of integer for which the given array will be complementary\n        vec[2]=n;\n        \n        for(int i=0;i<n/2;i++){\n            vec[min(nums[i],nums[n-i-1])+1]-=1;\n            vec[nums[i]+nums[n-i-1]]-=1;\n            vec[nums[i]+nums[n-i-1]+1]+=1;\n            vec[max(nums[i],nums[n-i-1])+limit+1]+=1;\n        }\n        for(int i=1;i<2*limit+2;i++){  // precomputation\n            vec[i]=vec[i]+vec[i-1];\n        }\n        return *min_element(vec.begin()+2,vec.end()-2);\n        \n        \n    }\n};
[]