You are viewing a single comment's thread. Return to all comments →
Python solution: maxSum =sum(arr) - arr[0] minSum =sum(arr) - arr[0]
for index in range(0,len(arr)): currentSum = sum(arr) - arr[index] if(currentSum > maxSum): maxSum = currentSum if(currentSum<minSum): minSum = currentSum 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 →
Python solution: maxSum =sum(arr) - arr[0] minSum =sum(arr) - arr[0]