Erase() leading to garbage

code : - https://onlinegdb.com/_7Tk8aB1P

hi @akashagarwal1321


I have corrected ur code… its not giving any error now…

1 Like

Can you pls make me understand why the line : -
// occurrence.insert(make_pair(i, 0ll));
led to the garbage value?

hi @akashagarwal1321
i am not sure why this line caused an error… i saw this type of thing for the first time… rest actually there was no need for the same also…

1 Like

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.