2256. Simple C++ solution
Code\n\nclass Solution {\npublic:\n    int minimumAverageDifference(vector<int>& nums) {\n        vector<long long int>v,u;\n        long long int ans=0;\n     
# Code\n```\nclass Solution {\npublic:\n    int minimumAverageDifference(vector<int>& nums) {\n        vector<long long int>v,u;\n        long long int ans=0;\n        for(int i=0;i<nums.size();i++)\n        {\n            ans+=nums[i];\n            v.push_back(ans/(i+1));\n        }\n        ans=0;\n        u.push_back(ans);\n        for(int j=nums.size()-1;j>=1;j--)\n        {\n            ans+=nums[j];\n            u.push_back(ans/(nums.size()-j));\n        }\n        reverse(u.begin(),u.end());\n        int k=0;\n        int a=abs(u[0]-v[0]);\n        for(int i=1;i<u.size();i++)\n        {\n            if(abs(u[i]-v[i])<a)\n            {\n                a=abs(u[i]-v[i]);\n                k=i;\n            }\n        }\n        return k;\n    }\n};\n```
['Array', 'Prefix Sum', 'C++']