Skip to content
Snippets Groups Projects
Commit ffabc1d4 authored by Le Quang Anh's avatar Le Quang Anh
Browse files

Fix segv: stop using iterator on mutated deque

Previously the code has segmentation fault during one of the solutions
(not every one). This was because when an item is inserted into the
deque, iterators are invalidated. Incrementing the iterator causes
undefined behavior, which somehow worked until that point in the program
but not afterwards. We have changed to use index instead of iterator on
the deque.
parent d56d5215
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment