Easy Cpp solution using Prefix and Suffix sum
```\nclass Solution {\npublic:\n    int minimumAverageDifference(vector& nums) {\n        int size=nums.size();\n        vector pref(size),suff(size);\n        
```\nclass Solution {\npublic:\n    int minimumAverageDifference(vector<int>& nums) {\n        int size=nums.size();\n        vector<long long int> pref(size),suff(size);\n        pref[0]=nums[0];\n        suff[size-1]=0;\n        long long int sum=nums[0];\n        for(int i=1;i<size;i++){\n            sum +=nums[i];\n            pref[i]=sum/(i+1);\n        }\n        sum=0;\n        for(int i=size-2,k=1;i>=0;i--,k++){\n            sum +=nums[i+1];\n            suff[i]=sum/k;\n        }\n        int m=INT_MAX,ind=0,temp;\n        for(int i=0;i<size;i++){\n            temp=abs(pref[i]-suff[i]);\n            if(m>temp){\n                m=temp;\n                ind=i;\n            }\n        }\n        return ind;\n    }\n};
[]