Hashing quiz problem

Give the space complexity for removing the specified characters in a string which are given in another string using the concept of Hashing (Consider the length of both strings to be n)

answer: O(1)

Kindly explain sir

if we make a hash of another string then
we can know in O(1) whether this character is present in other string or not
now we iterate on the sting and if that character present we move ahead otherwise
shit the string left
so the space complexity is O(1) if hashing is done already