Easy C++ Solution
\tclass Solution {\n\tpublic:\n\t\tint minimumAverageDifference(vector& nums) {\n\t\t\tlong long  n = nums.size(),sum = 0,total = accumulate(begin(nums),end(num
\tclass Solution {\n\tpublic:\n\t\tint minimumAverageDifference(vector<int>& nums) {\n\t\t\tlong long  n = nums.size(),sum = 0,total = accumulate(begin(nums),end(nums),0l);\n\t\t\tlong long maxi = LLONG_MAX,res = 0;\n\t\t\tfor(long long i = 0;i<n-1;i++){\n\t\t\t\tsum+=nums[i];\n\t\t\t\tlong long curr = abs(sum/(i+1) - (total-sum)/(n-i-1));\n\t\t\t\tif(curr<maxi) maxi = curr,res = i;\n\t\t\t}\n\n\t\t\treturn maxi>total/n ? n-1:res;\n\t\t}\n\t};
[]