You are viewing a single comment's thread. Return to all comments →
amazing approach! my code was of more than 10 lines
import sys from functools import reduce arr = list(map(int, input().strip().split(' '))) arr.sort() barr = arr.copy() barr.remove(arr[0]) d = reduce(lambda x,y:x+y,barr) arr.remove(arr[len(arr)-1]) c = reduce(lambda x, y: x + y, arr) print(c,d)
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 →
amazing approach! my code was of more than 10 lines