So i'm supposed to Move all palindrome numbers from mValues vector to mPalindromes vector
and the only hints I was given was a pseudo code: // iterate through the main values vector // if the value is a palindrome // add it to the palindrome vector // remove it from the values vector
and this is what I came up with:
for (int i = 0; i < mValues.size(); i++)
{
if (IsPalindromeNumber(mValues[i]) )
{
mPalindromes.push_back(mValues[i]);
mValues.pop_back();
}
}
If anyone could tell me where I went wrong I would appreciate it.
edit: I figured it out the problem was I was using erase instead of popback.