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
|
355 Discussions
|
Please Login in order to post a comment
I got error on half of the tests (C#) before I realized that the sum MUST be explicitly Long. Declaring it as var seems to make it Integer.
def miniMaxSum(arr): arr.sort() print(f"{sum(arr[:-1])} {sum(arr[1:])}")