Adityaxv's blog

By Adityaxv, 3 months ago, In English

My code gives runtime error for some testcases of this Problem.

My Solution

But when I add integer 0, n times in the multiset at the beginning, my code gets accepted. Why?

Added Part
  • Vote: I like it
  • 0
  • Vote: I do not like it

»
3 months ago, # |
  Vote: I like it 0 Vote: I do not like it

check if element exists before deleting

  • »
    »
    3 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Thanks! it worked. I always thought that erase function is capable of handling such case.