ALG-E005EasyStrings
Reverse the Message
Return text with all characters in reverse order. Preserve capitalization, spaces, and punctuation.
Contract
input text: string
return string
Constraints
- • 0 <= text length <= 1000
Examples
Example 1
text = "robot"
→ "tobor"
Example 2
text = "A b!"
→ "!b A"
5 judge tests (2 shown above). Target complexity: O(n).