
In Greenhouse Software, text from a candidate note or job post may need simple character-level transformation. Write a function that takes a string and returns the same string with its characters in reverse order.
ss in reverse orderYour function should preserve all characters exactly as they appear, including spaces, punctuation, and digits.
Example 1
s = "greenhouse""esuohneerg"Example 2
s = "Offer 2024!""!4202 reffO"0 <= len(s) <= 10^5s may contain letters, digits, spaces, and punctuationAim for a linear-time solution. Avoid unnecessary repeated string concatenation inside a loop if possible.
s = "greenhouse"Output"esuohneerg"WhyThe first character becomes the last, the second becomes the second-to-last, and so on.s = "Offer 2024!"Output"!4202 reffO"WhyAll characters are reversed, including the space and exclamation mark.s = ""Output""WhyAn empty string remains empty after reversal.0 <= len(s) <= 10^5s may contain letters, digits, spaces, and punctuationReturn a new reversed stringdef reverse_string(s):