1//Syntax
2*min_element(ForwardIt first, ForwardIt last)
3*min_element(ForwardIt first, ForwardIt last, Compare comp)
4//Example:
5#include <bits/stdc++.h>
6using namespace std;
7
8main() {
9 vector<int> v{ 3, 1, -14, 6, 5, 9 };
10 int result;
11
12 result = *min_element(v.begin(), v.end());
13 cout << "min element is: " << result << '\n'; //-14
14
15 result = *min_element(v.begin(), v.end(), [](int a, int b) { return abs(a)<abs(b); });
16 cout << "min element (absolute) is: " << result << '\n'; //1
17}