You are viewing a single comment's thread. Return to all comments →
Python solution (I tried to avoid loops, just for fun)
def miniMaxSum(arr): arr.sort() middle = sum(arr[i] for i in range(1,4)) minv = arr[0] + middle maxv = middle + arr[4]
print(minv, maxv)
if name == 'main':
arr = list(map(int, input().rstrip().split())) miniMaxSum(arr)
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 (I tried to avoid loops, just for fun)
def miniMaxSum(arr): arr.sort() middle = sum(arr[i] for i in range(1,4)) minv = arr[0] + middle maxv = middle + arr[4]
if name == 'main':