/multimap stl;
//here multiple element can have the same key
//#include<bits/stdc++.h>
#include
#include
#include
using namespace std;
//insetr(),find(),erase() with logn complexity
int main()
{
multimap<char,string>m;
int n;
cin>>n;
for(int i=0;i<n;i++)
{
char ch;
string s;
cin>>ch>>s;
m.insert(make_pair(ch,s));
}
//erase
auto it=m.begin();
m.erase(it);
//try to print the entire map;
for(auto p:m)
{
cout<<p.first<<" -->"<<p.second<<endl;
}
//search for cat
auto f=m.find(“c”);
if(f->second==“cat”)
{
m.erase(f);
}
for(auto p:m)
{
cout<<p.first<<"–>"<<p.second<<endl;
}
return 0;
}
//the code is not working due to find() function,please help me to resolve the problem