You are viewing a single comment's thread. Return to all comments →
In Golang:
func miniMaxSum(arr []int32) { sort.SliceStable(arr, func(i, j int) bool { return arr[i]<arr[j]}) var sum int64 = 0 for i := range arr{ sum += int64(arr[i]) } fmt.Println(sum-int64(arr[len(arr)-1]), sum-int64(arr[0])) }
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 →
In Golang: