I'm trying to convert some C++ code to another language but I'm struggling to understand what a couple lines of code are doing. Here are the two codes:
My understanding is that vector.erase erases any value from vector.start to vector.end - vector.erase(startpoint,endpoint)
But in the startpoint bit of the first code we have an if statement that seems to be doing the same thing? it removes values x from the vector if they satisfy the conditions, but then that somehow becomes the start point of the erase?
As for the second one, the beginning point is a vector? You remove non-unique contiguous values and then make that the startpoint?