how to use max element in c++ code example
Example 1: max element in vector c++
auto max = *max_element(vector.begin(), vector.end());
Example 2: c++ max of array
cout << " max element is: " << *max_element(array , array + n) << endl;
auto max = *max_element(vector.begin(), vector.end());
cout << " max element is: " << *max_element(array , array + n) << endl;