Easiest c++ solution approach with lowest complexity


#1

int Solution::solve(vector &A) {
int maxm=INT_MIN;
int minm=INT_MAX;
int count,value;
for(int i=0;i<A.size();i++){
count=A[i];
value=A[i];
maxm=max(count,maxm);
minm=min(value,minm);
}
return maxm+minm;

}