Problem Statment
Given an array A of size N . You need to find sum of
maximum and minimum element in the given array.
Note: you should make minimum number of comparisons.
Problem Constrains 1 <= N <= 105 -109 <= A[i] <= 109
Input Format
First and only argument is an integer array A of size N.
Output Format
Return an integer denoting the sum of maximum and minimum element in the given array.
Example 1:
A = [-2,1,-4,5,3]
>> 1
Example 2:
A=[1,3,4,1]
>> 5