I want to reverse a string without using any additional memory (O(1)
space complexity) in O(N)
time complexity, where N
is the length of the string.
I can’t use the string reverse in built function.
I want to reverse a string without using any additional memory (O(1)
space complexity) in O(N)
time complexity, where N
is the length of the string.
I can’t use the string reverse in built function.
You can't do this. Whoever is asking you to do this is
Python strings are immutable, which means they cannot be changed in-place.