Please read the new rule regarding the restriction on the use of AI tools. It applies starting from round 972. ×

Adityaxv's blog

By Adityaxv, 10 days 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

»
10 days ago, # |
  Vote: I like it 0 Vote: I do not like it

check if element exists before deleting

  • »
    »
    10 days 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.