C++|| My Solution || Easy to understand
Calculating the prefix sum will make the problem easy.\n\n\nclass Solution {\npublic:\n    int minimumAverageDifference(vector<int>& nums) {\n        \n        
Calculating the prefix sum will make the problem easy.\n\n```\nclass Solution {\npublic:\n    int minimumAverageDifference(vector<int>& nums) {\n        \n        vector<long long> prefix;\n        prefix.push_back(nums[0]);\n        \n        \n        for(int i=1;i<nums.size();i++){\n            prefix.push_back(nums[i]+prefix[i-1]);\n        }\n        \n        int min = INT_MAX;\n        int min_index = 0;\n        for(int i=0;i<nums.size();i++){\n            int diff;\n            if(nums.size() - i - 1==0)\n                diff = (prefix[i]/(i+1));\n            else\n            diff = (prefix[i]/(i+1)) - (prefix[nums.size()-1]-prefix[i])/(nums.size() - i - 1);\n            \n            diff = abs(diff);\n            if(diff<min){\n                min = diff;\n                min_index = i;\n            }\n        }\n        \n        return min_index;\n    }\n};\n```
['C', 'C++']