At Apple, a text-processing utility needs a function that reverses a string. Given a string s, return a new string with its characters in reverse order.
ss in reverse orderExample 1
Input: s = "swift"
Output: "tfiws"
Explanation: The characters are returned in reverse order.
Example 2
Input: s = "Hello, World!"
Output: "!dlroW ,olleH"
Explanation: Letters, punctuation, spaces, and symbols are all reversed as individual characters.
0 <= len(s) <= 10^5s may contain uppercase letters, lowercase letters, digits, spaces, and punctuationA correct solution should run in linear time with respect to the length of the string.