C++ || EASY TO UNDERSTAND || Simple Solution
\n#define ll long long int\nclass Solution {\npublic:\n    int minimumAverageDifference(vector<int>& nums) {\n        ll n=nums.size();\n        vector<ll> pref
```\n#define ll long long int\nclass Solution {\npublic:\n    int minimumAverageDifference(vector<int>& nums) {\n        ll n=nums.size();\n        vector<ll> prefix(n);\n        prefix[0]=nums[0];\n        for(ll i=1;i<n;i++)\n        {\n            prefix[i]=nums[i]+prefix[i-1];\n        }\n        ll mini=INT_MAX; \n        ll left,right;\n        ll ans=0;\n        for(ll i=0;i<n;i++)\n        {\n            left=prefix[i];\n            ll l,r;\n            l=i+1;\n            r=n-i-1;\n            ll v1,v2;\n            if(i==n-1)\n            {\n                 right=0;\n                 v1=left/l;\n                 v2=0;\n            }\n                else \n                {\n            right=prefix[n-1]-prefix[i];\n                     v1=left/l;\n                     v2=right/r;\n                }\n                \n                              ll x=abs(v1-v2);\n                              if(x<mini)\n                              {\n                                  mini=x;\n                                  ans=i;\n                          \n        }            \n        }\n    return ans;\n    }\n};\n```
[]