So, I\'m utilizing the following line to eliminate an element from vector a which is defined before:
a.erase(std::remove(a.begin(),a.end(), maxDigit), a.end()