Deletion of the last elem,ent in the multiset

multiset s;
s.erase(s.rbegin());
why this not working
i dont want to use find because i need to reduce the time complexiy

hi @vinishthanai you can use an unordered_multiset so that your find function works in O(1) time.
By the way, your syntax is correct for erasing, but note that the erase function causes undefined behaviour if an invalid position or range is passed in argument. You can refer to the documentation http://www.cplusplus.com/reference/set/multiset/erase/ for more info.

Please mark the doubt as resolved in case of no further queries.