Just 5 python Lines!


#1

class Solution:

def solve(self, A):
    A.sort()
    lastElem=len(A)-1
    return A[0]+A[lastElem]

#2

Respected @Bill1010:
its in order of nlog(n) but u can simplpy do it in ordr of n by just using min andmax which is order of O(n)only so two times O(n) thats it


#3

one line of code
return max(A)+min(A)