Mini-Max Sum

  • + 1 comment

    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)