EasyString· 63% acceptance
#435

Reverse String 35

Easy

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

Example 1

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

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

Constraints

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

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

reverseString

← All practice problems