Golang prefix sum solution
go\nfunc minimumAverageDifference(nums []int) int {\n\tsummation := make([]int, len(nums))\n\tsummation[0] = nums[0]\n\tfor i := 1; i < len(summation); i++ {\n\
```go\nfunc minimumAverageDifference(nums []int) int {\n\tsummation := make([]int, len(nums))\n\tsummation[0] = nums[0]\n\tfor i := 1; i < len(summation); i++ {\n\t\tsummation[i] = summation[i-1] + nums[i]\n\t}\n\tindex := len(nums) - 1\n\tminDiff := abs(summation[len(nums)-1] / len(nums))\n\tfor i := 0; i < len(summation)-1; i++ {\n\t\tcurDiff := abs(summation[i]/(i+1) - (summation[len(nums)-1]-summation[i])/(len(nums)-i-1))\n\t\t// index might be len(nums) - 1, so we must check index with i while curDiff equal to minDiff\n\t\tif curDiff < minDiff || (curDiff == minDiff && i < index) {\n\t\t\tminDiff, index = curDiff, i\n\t\t}\n\t}\n\treturn index\n}\n\nfunc abs(v int) int {\n\tif v > 0 {\n\t\treturn v\n\t}\n\treturn v * -1\n}\n```
['Go']