C++ Solution || Easy to Understand
\nclass Solution {\npublic:\n    int minimumAverageDifference(vector<int>& nums) \n    {\n        long long int n = nums.size();\n        \n        long long in
```\nclass Solution {\npublic:\n    int minimumAverageDifference(vector<int>& nums) \n    {\n        long long int n = nums.size();\n        \n        long long int left_sum = 0;\n        long long int right_sum = 0;\n        \n        priority_queue<pair<long long int,long long int>,vector<pair<long long int,long long int> >,greater<pair<long int,long int> > > pq;\n        \n        for(int i=0;i<n;i++)\n        {\n            right_sum += nums[i];\n        }\n        \n        long long int i = 0;\n        while(i<n)\n        {\n            right_sum -= nums[i];\n            left_sum  += nums[i]; \n            \n            long long int tmp=0;\n            \n            if(i < n-1){\n                tmp = abs((left_sum/(i+1)) - (right_sum/(n-i-1)));\n                                                                              \n            }\n            else\n                tmp = (left_sum/(i+1));\n            \n            pq.push({tmp,i});\n            i++;\n            \n        }\n        \n        return pq.top().second;\n    }\n};\n```
[]