naved momin wrote:
Is this algo is an in-place, according to me yes, because tmp[] is consider as auxiliary space, so space complexity still remains O(1)
Do you agree with my answer if no please explain me too
thanks for your time and effort..!!
I think not, but I could be wrong. I thought that "in place" means you swap elements within whatever structure you have. Further. I think your space complexity is actually O(N). The longer the
string is, the more additional memory you need.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors