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)

How is the answer O(1)??.. Shouldn’t it be O(n)?

Hey @gaganwalia212
So there are 256 unique characters so at max another string will have all of them this means we will use max 256 char memory which is constant
Hence O(1)

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.