Reverse String — JavaScript easy interview problem
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"]`.
Tags: two-pointers, in-place
Practice this Strings problem free in the JS Interview Playground with automated tests and unlockable solutions.