C++ || SIMPLE
\nclass Solution {\npublic:\n    #define ll long long\n    int minimumAverageDifference(vector<int>& nums) {\n        int n = nums.size();\n        int val = IN
```\nclass Solution {\npublic:\n    #define ll long long\n    int minimumAverageDifference(vector<int>& nums) {\n        int n = nums.size();\n        int val = INT_MAX;\n        int idx = 0;\n        \n        ll sum = 0,cur = 0;\n        for(int i:nums)sum += i;\n \n        for(int i=0;i<n;i++){\n            cur += nums[i];\n            sum -= nums[i];\n            \n            ll c_val = 0;\n            if(i == n-1){\n                c_val = cur/(i+1);\n            }\n            else c_val = abs((cur)/(i+1) - ((sum)/(n-i-1)));\n            if(c_val < val){\n                val = c_val;\n                idx = i;\n            }\n        } \n        return idx;\n    }\n};\n```
['C']