EasyString· 74% acceptance
#446

Reverse String 46

Easy

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

Example 1

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

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

Constraints

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

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

reverseString

← All practice problems