You are viewing a single comment's thread. Return to all comments →
Great solution! Slightly different way of doing it below too:
from functools import reduce arr = list(map(int, input().strip().split(' '))) min = reduce((lambda x, y: x + y), sorted(arr)[:-1]) max = reduce((lambda x, y: x + y), sorted(arr)[1:]) print(str(min) + " " + str(max))
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 →
Great solution! Slightly different way of doing it below too: