Easy python Solution || using prefix sum Run time 75%
Code\n\nclass Solution(object):\n    def minimumAverageDifference(self, nums):\n        """\n        :type nums: List[int]\n        :rtype: int\n        """\n  
# Code\n```\nclass Solution(object):\n    def minimumAverageDifference(self, nums):\n        """\n        :type nums: List[int]\n        :rtype: int\n        """\n        t_sm=sum(nums) #total sum\n        mx_idx=len(nums) #last index\n        st_sm=0 \n        mn_val=t_sm//len(nums)\n        mn_idx=len(nums)-1\n        for i in range(len(nums)-1):\n            t_sm-=nums[i]\n            st_sm+=nums[i]\n            mx_idx-=1\n            val=abs((st_sm//(i+1)) - (t_sm//mx_idx))\n            old_mn=mn_val\n            mn_val=min(mn_val,val)\n            if mn_val==val:\n                if old_mn==mn_val:\n                    mn_idx=min(i,mn_idx)\n                else:\n                    mn_idx=i\n        return mn_idx\n```
['Array', 'Prefix Sum', 'Python']