I have a collection of unique ints which is always unsorted, something like
[1, 56, 78, 89, 887, 98, 100, 0, 23, 114, 900]
I would like to quickly remove an element from the container, say 887 and the result should be
[1, 56, 78, 89, 98, 100, 0, 23, 114, 900]
I am currently using a vector and using this code to erase the element.
container.erase(std::remove(container.begin(), container.end(), elem), container.end());
where elem holds the value to be removed. This works but I have do this operation a million times or more and hence I would like to see if I can use any other algorithm or container to remove elements faster.