#include#include
cherry -> 3 banana -> 2 apple -> 5
#include#include
Key with highest value: appleIn this example, the rbegin function is used to obtain an iterator to the last element of the map, and the rend function is used to obtain a reverse iterator to the end of the map. The loop is then used to compare the values of each key-value pair with the current highest value, and update the highest key accordingly. Package/library: Standard C++ library