Dodomeki
Sign in

13. Reverse Text

Easy

Given a string texto, return a new string with the characters in reverse order. Assume the text contains only ASCII characters.

Example 1
Input: texto = "Mocka"
Output: "akcoM"
Example 2
Input: texto = "dois ponteiros"
Output: "sorietnop siod"
Constraints
  • 0 <= texto.length <= 10^5
  • texto contém apenas caracteres ASCII.
StringsTwo pointers
Caso 1
texto =
"Mocka"
Expected =
"akcoM"
Caso 2
texto =
"dois ponteiros"
Expected =
"sorietnop siod"

Run checks these 2 cases. Submit runs all 6, including hidden ones.