Problem with the unordered map

from where -1 is coming in the output. Is unordered map is not working properly?

Hello @gaurav19063 due to this property only unordered map is always asked to not to use.
Happy Learning!!

what is the property?

@gaurav19063 check this:


you have to check the existence of the element as well.
Happy Learning!!

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.