You are viewing a single comment's thread. Return to all comments →
`func miniMaxSum(arr []int32) { slices.Sort(arr) max:=0 min:=0
for i,j:=0,len(arr)-1;i<len(arr)-1;i,j=i+1,j-1{ min+=int(arr[i]) max+=int(arr[j]) } fmt.Println(min,max)
}
Seems like cookies are disabled on this browser, please enable them to open this website
Mini-Max Sum
You are viewing a single comment's thread. Return to all comments →
Go / Golang
`func miniMaxSum(arr []int32) { slices.Sort(arr) max:=0 min:=0
}