Open Zirafnik opened 4 months ago
If I am not mistaken [::-1] creates a new (reversed) string, which would give that solution a space complexity of O(n).
[::-1]
Instead we should just use a backwards iterator.
If I am not mistaken
[::-1]
creates a new (reversed) string, which would give that solution a space complexity of O(n).Instead we should just use a backwards iterator.