Space complexxity of reverse

why is the space complexity of reverse function in this case??? shilundt it be O(1) ??

You are taking an extra string variable to store the reversed string

string rev = s

This is why space complexity is not O(1)