You are viewing a single comment's thread. Return to all comments →
def miniMaxSum(arr): minSum = sum(arr) maxSum= 0 for i in arr: currSum = sum(arr[:arr.index(i)] + arr[arr.index(i)+1:]) if currSum > maxSum: maxSum = currSum if currSum < minSum: minSum = currSum print(minSum, maxSum)
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 →