Блог пользователя Adityaxv

Автор Adityaxv, 13 дней назад, По-английски

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
  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
13 дней назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

check if element exists before deleting

  • »
    »
    13 дней назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

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