
At Stripe, a text-processing utility needs a function that reverses a string. Given a string s, return a new string with the characters of s in reverse order.
ss, but in reverse orderYou should implement a function that handles letters, digits, spaces, punctuation, and Unicode characters as ordinary characters.
Example 1
s = "hello""olleh"Example 2
s = "a b!""!b a"0 <= len(s) <= 10^5s may contain uppercase and lowercase English letters, digits, whitespace, punctuation, and Unicode characterss = "hello"Output"olleh"WhyReading the characters from the end to the beginning gives `olleh`.s = "a b!"Output"!b a"WhyThe space and punctuation are treated like normal characters and are reversed as well.s = ""Output""WhyAn empty string has no characters, so the reversed result is also empty.0 <= len(s) <= 10^5s may contain letters, digits, spaces, punctuation, and Unicode charactersReturn a new string containing the reversed charactersdef reverse_string(s):