Prefix sum solution
Find the prefix sum from the start of the array to the end of the array. The loop through the array, keeping track of the minimum average difference at each ind
Find the prefix sum from the start of the array to the end of the array. The loop through the array, keeping track of the minimum average difference at each index\n```\ndef minimumAverageDifference(self, nums: List[int]) -> int:\n        \n        pre_sum=[]\n        pre=0\n        for i in range(len(nums)):\n            pre+=nums[i]\n            pre_sum.append(pre)\n        max_sum=pre_sum[-1]\n      \n        min_dif=float(\'+inf\')\n        idx=0\n        n=len(nums)\n        for i in range(len(nums)):\n            if i!=n-1:\n                present=(pre_sum[i]//(i+1)) -((max_sum-pre_sum[i])//(n-i-1))\n            else:\n                present=pre_sum[i]//(i+1)\n            \n            present=abs(present)\n            if present<min_dif:\n                idx=i\n                min_dif=present\n            \n        return idx\n```
['Prefix Sum', 'Python']