python beats 99.8%, easy to understand
Code\n\nclass Solution:\n    def minimumAverageDifference(self, nums: List[int]) -> int:\n        sumleft, sumright, lengthright, lengthleft, min, ind, = 0, sum
# Code\n```\nclass Solution:\n    def minimumAverageDifference(self, nums: List[int]) -> int:\n        sumleft, sumright, lengthright, lengthleft, min, ind, = 0, sum(nums), len(nums), 0, 9999999, 0\n        for i in range(len(nums)):\n            sumleft += nums[i]\n            sumright -= nums[i]\n            lengthleft+=1\n            lengthright-=1\n            if lengthright!=0:\n                val = (abs(sumleft//lengthleft - sumright//lengthright))\n            else:\n                val = (abs(sumleft//lengthleft))\n            if val<min:\n                min=val\n                ind = i\n        return ind\n```
['Python', 'Python3']