String Reversal

Easy2 seconds

Create a function that reverses a string. The function should take a string as input and return the reversed version of that string.

Examples:

Input: "hello"
Output: "olleh"

Characters are reversed: 'h' moves to the end, 'o' moves to the start, etc.

Input: "world"
Output: "dlrow"

Each character is reversed from its original position.

Constraints:

  • • 1 ≤ s.length ≤ 10^4
  • • s consists of printable ASCII characters
Loading...

Custom Test InputPress Ctrl + Enter to run

Output

Loading Environment...