Reverse String

Easy
strings

Write a function that reverses a string. The input is given as a list of characters s. Modify the list in place and return it.

Example:

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

Test Cases

Python Editor

Output

Click "Run" to see results...