Why is it correct partially?


#1

int Solution::removeElement(vector &a, int b) {
int i=0 ;
for(int j=0 ; j<a.size() ; j++ )
{
if(a[j]==b) continue ;
a[i]=a[j] ;
i++ ;
}
return i ;
}


#2

because you have to delete that element from vector also :frowning: