Easiest Solution using Prefix sum | Python
Approach\nhttps://youtu.be/ykR8MsLAsWk\n\n# Code\n\nclass Solution:\n    def minimumAverageDifference(self, nums: List[int]) -> int:\n        prefix_sum = [0] *
# Approach\nhttps://youtu.be/ykR8MsLAsWk\n\n# Code\n```\nclass Solution:\n    def minimumAverageDifference(self, nums: List[int]) -> int:\n        prefix_sum = [0] * (len(nums) + 1)\n        nums_len = len(nums)\n\n        for index, element in enumerate(nums):\n            prefix_sum[index+1] = prefix_sum[index] + element\n\n        minimum_avg = float(inf)\n        min_index = 0\n\n        for index, element in enumerate(prefix_sum[1:]):\n            right_sum = prefix_sum[-1] - element\n            avg_diff = abs((element//(index+1)) - (right_sum // max(nums_len-index-1, 1)))\n\n            if avg_diff < minimum_avg:\n                minimum_avg = avg_diff\n                min_index = index\n\n        return min_index\n\n```
['Array', 'Prefix Sum', 'Python3']