Multimap - Code problem

why in the second last loop…i am not able to decrement the value of each key…but this is working with maps…and not with multimaps

@archa_1712 That is not a valid syntax to remove from multimap.
Instead you can use .
for(auto &i:m)
{
i.second-=1;
}
Or refer to this code whichyou were doing.

why are you using ‘&’ ?

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.