I am getting WA on spoj if I modify the ‘Remove’ function as:
void Remove(int elem)
{
if(freq[elem] > 1)
{
freq[elem]--;
}
else{
distinct--;
freq[elem]--;
}
}
It would be really helpful ,if you could tell what’s wrong with this code.
I am getting WA on spoj if I modify the ‘Remove’ function as:
void Remove(int elem)
{
if(freq[elem] > 1)
{
freq[elem]--;
}
else{
distinct--;
freq[elem]--;
}
}
It would be really helpful ,if you could tell what’s wrong with this code.
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.