Given a string and an array of characters, remove the given characters from the string.string RemoveChars(string str, vector<char> chars)
{
bool map[256] = {false};
string ret = "";
for (char c : chars)
map[c] = true;
for (int i = 0; i < str.size(); i++)
{
if (!map[str[i]])
ret += str[i];
}
return ret;
} |