Accessing iterator after erasing it from set?

Правка en1, от Iiinertia_1412, 2022-10-15 21:40:00

Here are two codes for question- Your text to link here...

code 1-Your text to link here...

code 2-Your text to link here...

In code 1 iterator is erased first and dereferenced after that.(Runtime error at test 39).

In code 2 iterator is dereferenced first and erased from set after that.(Accepted)

If code 1 is wrong practice why it got accepted for 38 test cases?

Теги set, iterator

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Iiinertia_1412 2022-10-15 21:40:00 597 Initial revision (published)