xxxxxxxxxx
set<int> s = {1,2,3}
auto it = s.end();
it--;
cout<<*it<<"\n"; // This refers to last element of a set
xxxxxxxxxx
set<int> st {1,2,3,4};
// rbegin() meand reverse begin, means we will choose the first element
// from the end of the set (start counting from the end)
auto last (st.rbegin()); //get iterator of the first element from the end
cout << *last << endl; //get the value from the iterator (return 4)
// instead we could directly use :
cout << *(st.rbegin()) << endl; // return 4