EasyString· 69% acceptance
#424

Reverse String 24

Easy

Reverse the character array `s` in-place and return it. Variant **#24**.

Example 1

Input: s = ["v","a","r","i","a","n","t","2","4","c","o","d","e"]

Output: ["e","d","o","c","4","2","t","n","a","i","r","a","v"]

Constraints

  • 1 <= s.length <= 10^5
  • s[i] is printable ASCII

Acceptance: 69% · Topics: string, two-pointers

reverseString

← All practice problems