We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Mini-Max Sum
- Discussions
Mini-Max Sum
Mini-Max Sum
Sort by
recency
|
960 Discussions
|
Please Login in order to post a comment
Hi, Run Code is succesful and correct. But I cant submit as there is error "abort called". Please kindly inform how to submit if anyone know about this.
Problem is easy but 1 thing need to be considered is the number can be a big int. Golang code func miniMaxSum(arr []int32) { // Write your code here maxEle := arr[0] minEle := arr[0] sum := int64(0) for i := 0; i < len(arr); i ++ { sum += int64(arr[i]) if arr[i] > maxEle { maxEle = arr[i] } else { if arr[i] < minEle { minEle = arr[i] } } }
}
My Solution: