Skip to Main Content

Reverse String

Problem URL:Reverse String

My Solution

Python

Modified In-Place.

def reverseString(s: List[str]) -> None:
    for i in range(len(s)//2):
        s[i], s[-(i+1)] = s[-(i+1)], s[i]

Let's Connect

Twitter GitHub LinkedIn