Back to the 100
Problem 004Two Pointers
Easy

Reverse String

004

Given an array of characters, return the characters in reverse order.

EXAMPLES

Example 1
Input
{
  "s": [
    "h",
    "e",
    "l",
    "l",
    "o"
  ]
}

Output
[
  "o",
  "l",
  "l",
  "e",
  "h"
]

FUNCTION SHAPE

s: stringArraystringArray
00:00
3 local tests readyRun with ⌘/Ctrl + Enter. Your code stays in this browser.

Runs solve(...) locally in a browser worker. SWE Playbook does not submit your code. Only run code you trust; Python code may access the network.