You are viewing a single comment's thread. Return to all comments →
For Python 3, no matter how long your array is, it will always return you sum of smallest four values and largest four values:
def miniMaxSum(arr): print(sum(sorted(arr)[:4]),sum(sorted(arr)[-4:])))
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 →
For Python 3, no matter how long your array is, it will always return you sum of smallest four values and largest four values: