Partially Correct Solution...HELP!


#1

int Solution::removeElement(vector &A, int B)
{
int i=0;
while(i<A.size())
{
if(A[i]==B)
{
A.erase(A.begin()+i);
iā€“;
}
i++;
}
int n=A.size();
return n;
}


#2

using erase will cause u o(n) at each erase iteration which results tle