C++ 1 line using vector library


#1

return (*max_element(A.begin(),A.end())) + (*min_element(A.begin(),A.end()));