
Reverse the characters of a string and return the reversed result. Aim for a linear-time solution; a two-pointer implementation is preferred, and you can discuss a recursive alternative.
s = "hello"Output"olleh"WhyCharacters are reversed from end to start.s = "racecar"Output"racecar"WhyA palindrome remains the same after reversal.`0 <= len(s) <= 10^5``s` contains printable ASCII charactersReturn a new reversed string