Python3 Solution - All the Best :)


#1
def sol(A,i,j):
    if abs(i-j)<=1:
        return min(A[i],A[j]),max(A[i],A[j])
    else:
        a,b=sol(A,i,(i+j)//2)
        c,d=sol(A,(i+j)//2,j)
        return min(a,c),max(b,d)

class Solution:
    # @param A : list of integers
    # @return an integer
    def solve(self, A):
        
        a,b=sol(A,0,len(A)-1)
        
        return a+b