#2EasyStrings & Two Pointers· Opposite Direction Pointers
Reverse String In-Place
Input format
s: Array of characters
Output format
None (modify array in-place)
Examples
Input: s = ["h","e","l","l","o"]
Output: ["o","l","l","e","h"]
The input array is inverted in-place.
Constraints
- 1 <= s.length <= 10^5
- s[i] is a printable ASCII character.
Study first
- #two-pointers
- #strings
- #programming-fundamentals