AlgoEarth
array
greedy
math
string
hash_table
dynamic_programming
sorting

Reverse String

Given a string, reverse all of its characters and return the new string.

Example 1:

Input:

"hello"

Output:

"olleh"

Explanation: The string "hello" reversed is "olleh".

Example 2:

Input:

"world"

Output:

"dlrow"

Explanation: The string "world" reversed is "dlrow".

Constraints:

  • The input string consists of printable ASCII characters.
Loading...