Python || 91.23 % Faster || Prefix Sum || O(n) Solution
\nclass Solution:\n    def minimumAverageDifference(self, nums: List[int]) -> int:\n        n=len(nums)\n        pre,post=[nums[0]]*n,[nums[n-1]]*n\n        for
```\nclass Solution:\n    def minimumAverageDifference(self, nums: List[int]) -> int:\n        n=len(nums)\n        pre,post=[nums[0]]*n,[nums[n-1]]*n\n        for i in range(1,n):\n            pre[i]=(nums[i]+pre[i-1])\n        for i in range(n-2,-1,-1):\n            post[i]=(nums[i]+post[i+1])\n        m,f=1000000,n-1\n        for i in range(n):\n            x=pre[i]//(i+1)\n            if i==n-1:\n                y=0\n            else:\n                y=post[i+1]//(n-i-1)\n            if m>abs(x-y):\n                m=abs(x-y)\n                f=i\n        return f\n```\n\n**An upvote will be encouraging**
['Array', 'Prefix Sum', 'Python', 'Python3']