Strings

Reverse String

easy
Write a function that reverses a string. The input is given as an array of characters `s`. You must do this by modifying the input array in-place with O(1) extra memory. Return the same array. Example: `reverseString(["h","e","l","l","o"])` → `["o","l","l","e","h"]`.
Hint steps(0/3 revealed)
  1. 1

    Complete previous step or reveal to unlock this hint.

  2. 2

    Complete previous step or reveal to unlock this hint.

  3. 3

    Complete previous step or reveal to unlock this hint.